ExportDocumentRTF
Text extraction and conversion
Description
Extracts the whole document (or a page range) into a self-contained RTF document built on the same structured text model as the DOCX and Markdown writers: detected headings become bold styled headings with scaled sizes, paragraphs keep span-level fonts, sizes and colours through a shared font and colour table, and detected tables become bordered table rows
Pages are separated by page breaks; options accept PDF_RTF_DETECT_HEADINGS (1) and PDF_RTF_PRESERVE_STYLES (2), zero selecting both
Syntax
Delphi
Function TPDFlib.ExportDocumentRTF(Const PageRange: WideString; Options: Integer): WideString;ActiveX
Function PDFlib::ExportDocumentRTF(PageRange As String, Options As Long) As StringDLL
const wchar_t* DLExportDocumentRTF(int InstanceID, const wchar_t* PageRange, int Options);
const char* DLExportDocumentRTFA(int InstanceID, const char* PageRange, int Options);Parameters
| PageRange | A one-based range such as 1-3,7, or an empty string for every page |
|---|---|
| Options | A combination of PDF_RTF_DETECT_HEADINGS (1), PDF_RTF_PRESERVE_STYLES (2) and PDF_RTF_INCLUDE_IMAGES (4), or PDF_RTF_DEFAULT (7); any other bit sets PDFLIB_ERROR_MARKDOWN_EXPORT_INVALID |
Return values
| RTF | The complete RTF document as a WideString |
|---|---|
| Empty | Validation, cancellation or extraction failed; LastErrorCode carries the reason |