Aspose.Words for Python 是一個功能強大的本機類別庫,可用於眾多文件處理任務。它使開發人員能夠透過產生、修改、轉換和呈現文件等功能來增強自己的應用程序,而無需依賴第三方應用程序,例如 Microsoft Word 或 Office Automation。
此儲存庫包含一系列 Python 範例,可協助您學習和探索 API 功能。
以下是 Aspose.Words for Python 的一些熱門功能:
嘗試我們的免費線上應用程序,示範一些最受歡迎的 Aspose.Words 功能。
Aspose.Words for Python 支援多種載入和儲存文件的格式,以下列出了其中一些格式:
Microsoft Word: DOC、DOT、DOCX、DOTX、DOTM、FlatOpc、FlatOpcMacroEnabled、FlatOpcTemplate、FlatOpcTemplateMacroEnabled、RTF、WordML、DocPreWord60
開放文件: ODT、OTT
網頁: HTML、MHTML
降價: MD
標籤: XamlFixed、HtmlFixed、XamlFlow、XamlFlowPack
固定佈局: PDF、XPS、OpenXps
圖: SVG、TIFF、PNG、BMP、JPEG、GIF
圖元檔: EMF
印表機: PCL、PS
文字: TXT
電子書: MOBI、CHM、EPUB
Aspose.Words for Python 可用於為各種作業系統開發應用程序,例如安裝了 Python 3.5 或更高版本的 Windows 和 Linux。您可以建立 32 位元和 64 位元 Python 應用程式。
準備好嘗試 Aspose.Words for Python 了嗎?
只需從控制台執行pip install aspose-words
即可取得套件。如果您已經擁有 Aspose.Words for Python 並且想要升級版本,請執行pip install --upgrade aspose-words
來取得最新版本。
您可以在您的環境中執行以下程式碼片段來查看 Aspose.Words 的工作原理,或查看範例或 Aspose.Words for Python 文件以了解其他常見用例。
Aspose.Words for Python 可讓您建立新的空白文件並為該文件添加內容。
import aspose . words as aw
# Create a blank document.
doc = aw . Document ()
# Use a document builder to add content to the document.
builder = aw . DocumentBuilder ( doc )
# Write a new paragraph in the document with the text "Hello World!".
builder . writeln ( "Hello World!" )
# Save the document in DOCX format. Save format is automatically determined from the file extension.
doc . save ( "output.docx" )
Aspose.Words for Python 還允許您將 Microsoft Word 格式轉換為 PDF、XPS、Markdown、HTML、JPEG、TIFF 和其他檔案格式。以下程式碼片段示範了從 DOCX 到 HTML 的轉換:
import aspose . words as aw
# Load the document from the disc.
doc = aw . Document ( "TestDocument.docx" )
# Save the document to HTML format.
doc . save ( "output.html" )
此外,您可以將 PDF 文件匯入 Python 應用程式並將其匯出為 DOCX 格式文件,而無需安裝 Microsoft Word:
import aspose . words as aw
# Load the PDF document from the disc.
doc = aw . Document ( "TestDocument.pdf" )
# Save the document to DOCX format.
doc . save ( "output.docx" )
Dockerfile 包含用於設定 Linux 映像的指令,以便能夠透過 .Net 使用 Aspose.Words for Python。
產品頁面 |文檔 |演示 |範例 |部落格 |搜尋 |免費支援|臨時執照