Converters
Converters
Internal API — The classes on this page are not part of the public API and are not exported from the top-level
aspose.words_fosspackage. They are used internally by the export pipeline. Most developers should useDocument.save()instead. See Core Management for the public API.
Aspose.Words FOSS for Python uses specialized converter classes to transform the internal document model into output formats. ParagraphConverter handles text and formatting, TableConverter handles table structures, and ListHandler manages list formatting. These classes are implementation details and may change without notice.
Paragraph Converter
ParagraphConverter transforms document paragraphs into the target output format. It inspects paragraph formatting, run-level styling, and inline content.
| Method | Description |
|---|---|
ParagraphConverter.get_paragraph_info() | Extract formatting information from a paragraph |
ParagraphConverter.get_run_formatting() | Get formatting details for a text run |
ParagraphConverter.format_text() | Apply formatting to text content |
Table Converter
TableConverter converts document tables into the target format (such as Markdown tables).
| Method | Description |
|---|---|
TableConverter.convert() | Convert a table element to the output format |
List Handler
ListHandler manages list state during document conversion, tracking list nesting, markers, and formatting.
| Method | Description |
|---|---|
ListHandler.set_reader() | Set the document reader for list context |
ListHandler.reset() | Reset list tracking state |
ListHandler.get_list_info() | Get list item details for a paragraph |
ListHandler.format_list_item() | Format a list item with marker and indentation |
ListHandler.break_list() | Signal end of a list sequence |
Tips and Best Practices
- Converters are used internally by the export pipeline — most developers interact with
Document.save()instead ParagraphConverter.format_text()respects code block context to avoid applying inline formatting inside code spansListHandlermaintains state across consecutive list paragraphs — callreset()when starting a new document section
Common Issues
| Issue | Cause | Fix |
|---|---|---|
| Misaligned table columns | Input table has merged cells | TableConverter handles simple tables; merged cells may produce unexpected output |
| Broken list numbering | List state not reset between sections | Call ListHandler.reset() at section boundaries |
API Reference Summary
| Class / Method | Description |
|---|---|
ParagraphConverter.get_paragraph_info() | Extract paragraph formatting |
ParagraphConverter.get_run_formatting() | Get run-level formatting |
ParagraphConverter.format_text() | Apply formatting to text |
TableConverter.convert() | Convert a table to output format |
ListHandler.set_reader() | Set document reader context |
ListHandler.get_list_info() | Get list item details |
ListHandler.format_list_item() | Format a list item |