ExportDocumentMarkdown

Text, extraction, Markdown

Description

Exports a selected PDF page range into one semantic Markdown string suitable for search indexing, knowledge bases, and language-model ingestion

Syntax

Delphi

Function TPDFlib.ExportDocumentMarkdown(Const PageRange: WideString;
  Options: Integer): WideString;

ActiveX

Function PDFlib::ExportDocumentMarkdown(PageRange As String,
  Options As Long) As String

DLL

const wchar_t* DLExportDocumentMarkdown(int InstanceID,
  const wchar_t* PageRange, int Options);
const char* DLExportDocumentMarkdownA(int InstanceID,
  const char* PageRange, int Options);

Parameters

PageRangeA one-based range such as 1-3,7, or an empty string for every page; explicit page order is preserved
OptionsThe option mask documented by ExportPageMarkdown

Return values

Returns the combined Markdown text, or an empty string when validation, cancellation, or extraction fails

Remarks

When page markers are enabled, each selected page starts with a stable <!-- page: N --> marker

The exporter retains only the current page hierarchy while assembling the string and restores the selected page before returning

Use SaveMarkdownToStream or SaveMarkdownToFile when the complete document output should not be buffered in memory

Progress and cooperative cancellation use the normal document operation lifecycle

LastErrorCode is 113 for an invalid range or option mask and 517 when extraction fails

See also

ExportPageMarkdown, SaveMarkdownToStream, ExtractStructuredDocument