Package: aspose-words
Product Page|Docs|Demos|API Reference|Examples|Blog|Search|Free Support|Temporary LicenseTry ourfree online Appsdemonstrating some of the most popular Aspose.Words functionality.Aspose.Words for Pythonis a powerful on-premise class library that can be used for numerous document processing tasks. It enables developers to enhance their own applications with features such as generating, modifying, converting, rendering, and printing documents, without relying on third-party applications, for example, Microsoft Word, or automation.Word API FeaturesThe following are some popular features of Aspose.Words for Python:Aspose.Words can be used to develop applications for a vast range of operating systems such as Windows, Linux or MacOS X.Comprehensivedocument import and exportwith35+ supported file formats. This allows users toconvert documentsfrom one popular format to another, for example, from DOCX into PDF or Markdown, or from PDF into various Word formats.Programmatic access to the formatting properties of all document elements. For example, using Aspose.Words users cansplit a documentinto parts orcompare two documents.High fidelity renderingof document pages. For example, if it is needed to render a document as in Microsoft Word, Aspose.Words will successfully cope with this task.Generate reports with Mail Merge, which allows filling in merge templates with data from various sources to create merged documents.LINQ Reporting Engine to fetch data from databases, XML, JSON, OData, external documents, and much more.Supported Document FormatsAspose.Words for Python supportsa wide range of formats for loading and saving documents, some of them are listed below:Microsoft Word:DOC, DOT, DOCX, DOTX, DOTM, FlatOpc, FlatOpcMacroEnabled, FlatOpcTemplate, FlatOpcTemplateMacroEnabled, RTF, WordML, DocPreWord60OpenDocument:ODT, OTTWeb:HTML, MHTMLMarkdown:MDMarkup:XamlFixed, HtmlFixed, XamlFlow, XamlFlowPackFixed Layout:PDF, XPS, OpenXpsImage:SVG, TIFF, PNG, BMP, JPEG, GIFMetafile:EMFPrinter:PCL, PSText:TXTeBook:MOBI, CHM, EPUBPlatform IndependenceAspose.Words for Python can be used to develop applications for a vast range of operating systems, such as Windows, Linux and MacOS X, where Python 3.5 or later is installed. You can build both 32-bit and 64-bit Python applications.Get StartedReady to give Aspose.Words for Python a try?Simply runpip install aspose-wordsfrom the Console to fetch the package.
If you already have Aspose.Words for Python and want to upgrade the version, please runpip install --upgrade aspose-wordsto get the latest version.You can run the following snippets in your environment to see how Aspose.Words works, or check out theGitHub RepositoryorAspose.Words for Python Documentationfor other common use cases.Using Python to Create a DOCX File from ScratchAspose.Words for Python allows you to create a new blank document and add content to this document.importaspose.wordsasaw# 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")Using Python to Convert a Word Document to HTMLAspose.Words for Python also allows you to convert Microsoft Word formats to PDF, XPS, Markdown, HTML, JPEG, TIFF, and other file formats. The following snippet demonstrates the conversion from DOCX to HTML:importaspose.wordsasaw# Load the document from the disc.doc=aw.Document("TestDocument.docx")# Save the document to HTML format.doc.save("output.html")Using Python to Import PDF and Save as a DOCX FileIn addition, you can import a PDF document into your Python application and export it as a DOCX format file without the need to install Microsoft Word:importaspose.wordsasaw# Load the PDF document from the disc.doc=aw.Document("TestDocument.pdf")# Save the document to DOCX format.doc.save("output.docx")Product Page|Docs|Demos|API Reference|Examples|Blog|Search|Free Support|Temporary License