ExportDocumentHTML
Text, images, extraction, HTML
Description
Exports a selected page range into one standalone HTML5 document with one positioned page section per selected page
Syntax
Delphi
Function TPDFlib.ExportDocumentHTML(Const PageRange: WideString;
Options: Integer): WideString;ActiveX
Function PDFlib::ExportDocumentHTML(PageRange As String,
Options As Long) As StringDLL
const wchar_t* DLExportDocumentHTML(int InstanceID,
const wchar_t* PageRange, int Options);
const char* DLExportDocumentHTMLA(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; explicit page order is preserved |
|---|---|
| Options | Zero selects PDF_HTML_DEFAULT; otherwise combine the image, link, and text inclusion flags documented by ExportPageHTML |
Return values
Returns one self-contained HTML5 document, or an empty string when validation, cancellation, or extraction fails
Remarks
Only the current page funnel and its encoded image data are retained while the output is assembled, so extraction memory follows the most complex selected page rather than the page count
Internal link annotations target stable #page-N anchors inside the generated document
The selected page is restored before the call returns
Progress and cooperative cancellation use the normal document operation lifecycle
LastErrorCode is 112 for invalid range or options and 516 when export fails
See also
ExportPageHTML, ExtractStructuredDocument, RenderDocumentToFile