Aspose.Words FOSS for Python API Reference
API reference for Aspose.Words FOSS for Python v26.7.0. 189 public types organized by module.
Core API
| Class | Description |
|---|---|
Body | The Body class aggregates paragraphs and tables and lets you retrieve child nodes of a specific type with get_child_nodes(node_type, deep). |
Border | Border.line_style is an integer representing the border’s line style. |
Cell | Cell objects expose a cell_format property that provides width, padding, vertical alignment, and shading options via the CellFormat class. |
CellFormat | CellFormat.width specifies the absolute width of the table cell in points. |
ConditionalStyleMask | Parsed ```` 12-bit bitmask for banded-table regions. |
DocList | DocList.list_id is the identifier of the list within the document. |
Document | The Document class represents a Word document and provides the get_text() method to extract the full plain‑text content of the file. |
DocumentFormatReader | Protocol defining the interface all document readers must implement. |
FieldEnd | FieldEnd is a class in Aspose.Words FOSS for Python exposing the field_type, has_separator, type properties. |
FieldSeparator | FieldSeparator is a class in Aspose.Words FOSS for Python exposing the field_type, type properties. |
FieldStart | FieldStart.type is a string indicating the field’s type name. |
Font | Font.name stores the font family name as a string. |
FrameFormat | Floating text-frame definition. |
HeaderFooter | HeaderFooter.type is a string representing the header/footer content type. |
ImageData | ImageData.from_mime(‘image/png’) returns the integer constant representing the PNG image type. |
ListFormat | ListFormat exposes whether a paragraph is part of a list and provides the list level and identifier through is_list_item, list_level_number, and list_id. |
ListLabel | Snapshot of a list-item’s rendered bullet/number label. |
ListLevel | ListLevel.number_format specifies the numeric format string for the list level. |
ListLevelOverride | One inside a concrete. |
LoadOptions | Options for loading a document. |
NodeCastMixin | as_*() casts mirroring aspose.words.Node; identity here. |
NodeType | Node type discriminators, valued as in aspose.words. |
OoxmlSaveOptions | Options for saving a document as DOCX (Office Open XML). |
PageSetup | PageSetup exposes page layout properties like paper size, margins, and orientation, allowing developers to programmatically configure document pagination. |
Paragraph | A paragraph whose children — Run, BookmarkStart / End, FieldStart / Separator / End and inline Shape — sit in a single ordered collection in document order. |
ParagraphFormat | ParagraphFormat.alignment specifies the horizontal alignment of the paragraph. |
ParagraphInfo | Information about a paragraph’s style and context. |
PdfSaveOptions | Options for saving documents as PDF. |
PreferredWidth | Preferred width of a table / cell. |
Row | Row.as_cell() returns the Row instance cast as a Cell when the underlying node is a table cell, enabling cell‑specific operations. |
RowFormat | RowFormat properties let developers control table row height, height rule, heading format, page‑break behavior, conditional style, and borders. |
RtfFileReader | Reads RTF files (OLE2-format) and produces the same data structures as DocumentReader (for .docx) and DocFileReader (for .doc). |
Run | Run.text holds the literal text content of the run. |
RunFormatting | Text run formatting properties. |
Section | Section objects provide as_body(), as_paragraph(), as_table(), etc., to cast a generic section node to a specific element type. |
Shading | Shading is a class in Aspose.Words FOSS for Python exposing the background_pattern_color, foreground_pattern_color properties. |
Shape | Shape objects expose geometry and content properties such as width, height, image_data and text_box, and can be cast to other node types via as_body(), as_paragraph(), etc. |
Style | Style.name is the identifier string of the style. |
TabStop | TabStop is a class in Aspose.Words FOSS for Python exposing the alignment, is_clear, leader, position properties. |
TabStopCollection | TabStopCollection.add(position, alignment, leader) creates a new TabStop with the specified position, alignment (e.g., TabAlignment.LEFT) and leader (e.g., TabLeader.DOT). |
Table | Table conversion to Markdown is handled by TableConverter, which respects table style properties and content alignment. |
TableCell | Represents a table cell. |
TableRow | Represents a table row. |
TableStyleFormat | Table-level properties stored on table styles (w:tblPr inside w:style). |
TableStyleProperty | Conditional formatting for a table region (w:tblStylePr). |
TextColumn | TextColumn is a class in Aspose.Words FOSS for Python exposing the space_after, width properties. |
TextColumns | TextColumns exposes properties count, evenly_spaced, spacing, line_between, and columns to configure multi‑column layout in a document. |
TextFileReader | Reads plain-text (.txt) files and yields one Paragraph per line. |
UnknownNode | UnknownNode is a class in Aspose.Words FOSS for Python exposing the type property. |
Enumerations
| Enumeration | Description |
|---|---|
CodeBlockStyle | Code block style preference. |
ColorMode | Color rendering mode. |
CompressionLevel | Compression level for OOXML files. |
HeadingStyle | Heading export style preference. |
LoadFormat | Document load format constants, valued as in aspose.words. |
PdfFontEmbeddingMode | Font embedding mode in PDF. |
PdfImageCompression | Image compression in PDF. |
PdfPageMode | PDF page display mode. |
PdfTextCompression | Text compression in PDF. |
PdfZoomBehavior | Mirrors public API. |
SaveFormat | Document save format constants, valued as in aspose.words. |
TableContentAlignment | Table content alignment options. |
Zip64Mode | Controls when to use ZIP64 format extensions for OOXML files. |
Compliance
| Enumeration | Description |
|---|---|
OoxmlCompliance | OOXML standards compliance level. |
PdfCompliance | PDF standards compliance level. |
Conversion
| Class | Description |
|---|---|
ConversionOptions | Options for controlling DOCX to Markdown conversion. |
LdmMarkdownWriter | Converts a light_document_model.Document to a Markdown string. |
MarkdownFileReader | Reads Markdown (.md) files and yields one Paragraph per line. |
MarkdownLoadOptions | Load options specific to Markdown (.md) input. |
MarkdownReader | Reads Markdown (.md) files, producing the same data structures as DocumentReader (for .docx) and DocFileReader (for .doc). |
MarkdownSaveOptions | Options for saving documents as Markdown. |
Enumerations
| Enumeration | Description |
|---|---|
MarkdownEmptyParagraphExportMode | Controls how empty paragraphs are exported. |
MarkdownExportAsHtml | Controls which elements are exported as raw HTML. |
MarkdownLinkExportMode | Link export mode options. |
MarkdownListExportMode | List export mode options. |
Converters
| Class | Description |
|---|---|
ListHandler | Handles parsing and conversion of lists. |
ParagraphConverter | Handles conversion of paragraphs to Markdown. |
TableConverter | Handles conversion of tables to Markdown. |
Doc Reader
| Class | Description |
|---|---|
BlipInfo | Parsed BSE (Blip Store Entry) with location of image data. |
CharProps | Properties extracted from CHPX for a text run. |
ChildAnchorInfo | Position of a child shape within its parent group’s coordinate system. |
DocFileReader | Full DOC reader with LDM (Light Document Model) building capability. |
DocFileReaderCore | Core reader for Word 97-2003 (.doc) files. |
DocTableBuilderMixin | Mixin that adds table-building helpers to the DOC reader. |
FibData | Parsed FIB (File Information Block) data. |
GroupShapeInfo | Coordinate system of a shape group (from Spgr record). |
ListDef | Parsed list definition with full level information. |
ListLevelData | One parsed LVL record (measurements in points). |
ParaProps | Properties extracted from PAPX for a single paragraph. |
ShapeAnchor | Parsed SPA (Shape Address) from PlcSpaMom / PlcSpaHdr. |
ShapeCropInfo | Escher crop properties for a shape (from FOpt records). |
ShapeLineProps | Escher line/fill properties for a shape (from FOpt records). |
StyleData | Properties parsed from a style definition (STSH UPX). |
TableRowProps | Properties extracted from PAPX SPRMs on table row-end paragraphs. |
Docx Reader
| Class | Description |
|---|---|
CellBuilder | Build :class:ldm.Cell from a ```` element. |
CellData | Table cell. |
DocumentReader | Reads DOCX documents and produces abstracted data structures. |
FontBuilder | Build a non-cascaded :class:ldm.Font from one ````. |
FontResolver | Compose a fully cascaded :class:ldm.Font. |
LdmBuilderMixin | Mixin that adds :meth:to_light_document to :class:DocumentReader. |
ListBuilder | Translate ```` into a list of :class:ldm.DocList. |
NumberingInfo | Numbering definition. |
NumberingLevel | List level definition. |
PageSetupBuilder | Build :class:ldm.PageSetup from a ```` element. |
ParagraphBuilder | Build :class:ldm.Paragraph from a ```` element. |
ParagraphData | Paragraph with style and content. |
ParagraphFormatBuilder | Build a non-cascaded :class:ldm.ParagraphFormat from one ````. |
ParagraphFormatResolver | Compose a fully cascaded :class:ldm.ParagraphFormat. |
ReaderContext | ReaderContext is a class in Aspose.Words FOSS for Python that extends Protocol. |
RowBuilder | Build :class:ldm.Row from a ```` element. |
RowData | Table row. |
RunBuilder | Build a single :class:ldm.Run with a resolved font cascade. |
RunData | Text run with formatting. |
SectionBuilder | Split the body into :class:ldm.Section\ s at sectPr boundaries. |
ShapeParserMixin | Mixin providing drawing/shape parsing methods for DocumentReader. |
StyleBuilder | Translate ```` into a list of :class:ldm.Style. |
StyleChainResolver | Walk the ```` graph for a styleId. |
TableBuilder | Build :class:ldm.Table from a ```` element. |
TableData | Table structure. |
Docx Writer
| Class | Description |
|---|---|
BookmarkState | Hands out monotonically increasing bookmark ids and pairs starts/ends across paragraphs. |
DocxWriterLossyWarning | Warns the caller that the writer is dropping known LDM constructs. |
ImageEntry | One image to add to word/media/ plus its relationship row. |
ImageRenderState | Accumulator threaded through paragraph rendering for inline shapes. |
LdmDocxWriter | Convert an :class:ldm.Document into a DOCX file. |
Md Import
| Class | Description |
|---|---|
AtxHeadingBlock | AtxHeadingBlock represents an ATX style heading and provides a level property and add_child(child) / get_parent() methods for tree manipulation. |
AutolinkBlock | AutolinkBlock stores hyperlink display text in the text property and its target URI in the uri property. |
Block | Base class for every node in the Markdown block tree. |
BoldInlineBlock | BoldInlineBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
BulletListItemBlock | BulletListItemBlock exposes the list marker via the marker property, the starting number via start_at, and its nesting depth via the get_level() method. |
CellBlock | CellBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
DocumentBlock | DocumentBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
FencedCodeBlock | FencedCodeBlock represents a fenced code block in Markdown with properties such as code, info, and fence_char, and supports the standard block navigation API. |
FootnoteDefinitionBlock | FootnoteDefinitionBlock.add_child(child) links a new child Block into the footnote hierarchy and returns the added Block. |
FootnoteReferenceBlock | FootnoteReferenceBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
HeadingBlock | HeadingBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
HorizontalRuleBlock | HorizontalRuleBlock objects can be linked into a document tree by calling add_child(child) and navigating with get_parent(), next_sibling, and previous_sibling properties. |
HtmlInsertOptions | Flags for :meth:MarkdownDocumentBuilder.insert_html (mirrors Aspose.Words’ HtmlInsertOptions). |
HtmlTagBlock | A raw HTML tag, block-level or inline (Markdig’s HtmlBlock / HtmlInline, folded into one node here). |
IndentedCodeBlock | IndentedCodeBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
InlineCodeBlock | InlineCodeBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
ItalicInlineBlock | ItalicInlineBlock provides navigation properties such as next_sibling, previous_sibling, and parent, enabling it to be placed within an inline hierarchy. |
LineBreakBlock | LineBreakBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
LinkTextBlock | LinkTextBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
ListBlock | Container grouping sibling ListItemBlocks (Markdig’s ListBlock). |
ListItemBlock | ListItemBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_level, get_list_container, get_parent. |
MarkdownDocumentBuilder | LDM cursor/writer used by :class:MarkdownReaderContext. |
MarkdownReaderContext | Drives Markdown block-tree events into a fresh LDM Document. |
OrderedListItemBlock | OrderedListItemBlock.get_level() returns the integer depth of the list item within its parent list. |
ParagraphBlock | ParagraphBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
QuoteBlock | QuoteBlock objects represent block‑quote structures; you can add nested children with add_child() and navigate siblings via next_sibling and previous_sibling. |
RowBlock | RowBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
SetextHeadingBlock | SetextHeadingBlock and StrikethroughBlock both implement a generic block interface with child‑management methods add_child() and get_parent(). |
StrikethroughBlock | StrikethroughBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
TableBlock | TableBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
TextBlock | A literal run of text (Markdig’s LiteralInline). |
UnderlineBlock | UnderlineBlock is a class in Aspose.Words FOSS for Python exposing __init__, __repr__, add_child, get_parent. |
Enumerations
| Enumeration | Description |
|---|---|
BlockType | BlockType is an enumeration in Aspose.Words FOSS for Python defining DOCUMENT, PARAGRAPH, ATX_HEADING, SETEXT_HEADING, QUOTE, INDENTED_CODE, and 20 more. |
ListMarker | Bullet/ordered list marker, mirroring Aspose.Words’ ListMarker. |
MarkdownBlockLevel | Where a block sits in the tree. |
Model
| Class | Description |
|---|---|
CellMerge | Specifies how a cell in a table is merged with other cells. |
CellVerticalAlignment | Specifies vertical justification of text inside a table cell. |
HeightRule | Specifies the rule for determining the height of an object. |
ImageType | Specifies the type (format) of an image in a document. |
LineSpacingRule | Specifies values for line spacing. |
LineStyle | Specifies line style of a border. |
NumberStyle | Specifies the number style for a list, footnotes, endnotes, page numbers. |
Orientation | Specifies page orientation. |
ParagraphAlignment | Specifies text alignment in a paragraph. |
PreferredWidthType | Specifies the unit of measurement for the preferred width of a table or cell. |
SectionStart | Specifies the type of break at the beginning of the section. |
StyleIdentifier | Locale-independent built-in style identifier. |
StyleType | Specifies type of the style. |
TabAlignment | Tab stop alignment. |
TabLeader | Tab stop leader character. |
Underline | Specifies type of the underline applied to a font. |
WrapType | Specifies how text is wrapped around a shape or picture. |
Parsers
| Class | Description |
|---|---|
ListInfo | Information about a list. |
ListLevelInfo | Information about a list level. |
NumberingParser | Parser for DOCX numbering definitions. |
ParsedStyle | Parsed style information. |
StyleParser | Parser for DOCX style names and properties. |
Pdf Writer
| Class | Description |
|---|---|
LdmPdfWriter | Converts a light_document_model.Document to a PDF file. |
PDFWriterContext | PDFWriterContext is a class in Aspose.Words FOSS for Python exposing the options property. |
ParagraphRenderer | Renders LDM paragraphs into PDF. |
RunRenderer | Renders formatted runs (text segments with fonts, colors, links). |
ShapeRenderer | Renders shapes, images, and positioned elements. |
TableRenderer | Renders LDM tables into PDF. |
Structure
| Class | Description |
|---|---|
BookmarkEnd | BookmarkEnd objects expose the type and name properties to identify the end of a bookmark in the document model. |
BookmarkStart | Marks the beginning of a Word bookmark (````). |
OutlineOptions | Controls how outlines (bookmarks panel) are generated in the PDF. |