Document class for loading files, along with dedicated LdmMarkdownWriter and LdmPdfWriter classes that write a loaded document to Markdown or PDF and accept save-options objects like PdfSaveOptions and MarkdownSaveOptions. Note: most save-options properties are defined for API forward-compatibility and are not yet consumed by the writers; only MarkdownSaveOptions.export_underline_formatting currently affects output. Install with a single pip install command. The library requires Python 3.10 or later and depends on olefile, fpdf2, and pydantic. For enterprise features and support, see Aspose.Words for Python — Enterprise Product.Document class.SaveFormat.PDF or PdfSaveOptions.SaveFormat.MARKDOWN or MarkdownSaveOptions.Document.text property.SaveFormat.TEXT.PdfSaveOptions: PDF export configuration class (properties are forward-compatibility stubs; not yet applied by the writer).MarkdownSaveOptions: Markdown export configuration (only export_underline_formatting is currently applied; other properties are forward-compatibility stubs).SaveFormat.MARKDOWN, SaveFormat.PDF, and SaveFormat.TEXT for quick conversion.Aspose.Words FOSS installs with a single pip install command. Runtime dependencies (olefile, fpdf2, pydantic) are installed automatically.
The API is straightforward: load a Document from a file path, then write it with LdmMarkdownWriter or LdmPdfWriter. For advanced control, pass a save-options object to the writer instead of using the defaults. The library is MIT-licensed, open-source on GitHub, and requires Python 3.10 or later.
Load a Word document and save it as Markdown.
import aspose.words_foss as aw
from aspose.words_foss.md_writer import LdmMarkdownWriter
document = aw.Document("input.docx") # or .doc, .rtf, .txt, .md
LdmMarkdownWriter().write(document, "output.md")
Export a Word document to PDF format.
import aspose.words_foss as aw
from aspose.words_foss.pdf_writer import LdmPdfWriter
document = aw.Document("input.docx")
LdmPdfWriter().write(document, "output.pdf")
Read all text content from a Word document.
import aspose.words_foss as aw
document = aw.Document("input.docx")
text = document.text
Aspose.Words FOSS for Python is released under the MIT license. You can use, modify, and distribute it in commercial and personal projects.
Install with a single pip install command. Requires Python 3.10 or later.
The library reads DOCX, DOC, RTF, TXT, and Markdown files and exports to PDF, Markdown, and plain text.
Use Document("input.docx") to initialize the document object. Save as PDF with LdmPdfWriter().write(document, "output.pdf").