SaveMarkdownToFile
Text, extraction, Markdown, files
Description
Writes semantic Markdown for a PDF page range directly to a UTF-8 file
Output is generated in a temporary file beside the destination and replaces it only after the complete export succeeds; invalid page selections, cancellation, generation failures, and publication failures preserve an existing destination
Syntax
Delphi
Function TPDFlib.SaveMarkdownToFile(Const PageRange: WideString;
Options: Integer; Const FileName: WideString): Integer;ActiveX
Function PDFlib::SaveMarkdownToFile(PageRange As String, Options As Long, FileName As String) As LongDLL
int DLSaveMarkdownToFile(int InstanceID, const wchar_t* PageRange, int Options, const wchar_t* FileName);
int DLSaveMarkdownToFileA(int InstanceID, const char* PageRange, int Options, const char* FileName);Parameters
| PageRange | A one-based page range, or an empty string for every page |
|---|---|
| Options | The option mask documented by ExportPageMarkdown |
| FileName | The destination file path |
Return values
Returns the number of pages written, or zero when validation, extraction, or file writing fails
Remarks
The output file is UTF-8 without a byte-order mark
Document-wide analysis and serialization retain selected page models and complete Markdown and UTF-8 buffers, as described by SaveMarkdownToStream
Reading order, furniture, merged cells, and continued tables follow ExportDocumentMarkdown and SetStructuredTextOptions
Extraction preserves the selected page and open writer tag stack; current unsaved writer tags are included without closing tags or finalizing the document
LastErrorCode is 113 for invalid arguments and 517 for extraction or file failures
See also
SaveMarkdownToStream, ExportDocumentMarkdown, SavePageRangeTextToFile