public getText(startBlock as Int = 1, maxBlocks as Int = 0) as String throws DocxException, IOException
Extracts and returns document text formatted in Markdown, optionally bounded to a range of paragraphs or blocks.
Headings are formatted with #, ##, ###, bullet lists with - , tables as Markdown tables, and body paragraphs separated by double newlines.
| Parameter | Description |
|---|---|
startBlock | 1-based index of the first paragraph/block to include (default: 1). |
maxBlocks | Maximum number of paragraphs/blocks to include (0 for all remaining blocks). |
Formatted document content in Markdown.
try doc = DocxDocument("notes.docx"):
content = doc.getText(1, 50)