ExportDocumentData
Document properties, Bookmarks
Description
Exports the document information keys, the whole bookmark tree and the page label ranges as editable plain text.
Syntax
Delphi
Function TPDFlib.ExportDocumentData(Options: Integer): WideString;Parameters
| Options | Record kinds to process: 0 selects everything, otherwise combine bit 1 (document information keys), bit 2 (bookmarks) and bit 4 (page label ranges). |
|---|
Return values
| '' | No document is selected or nothing matched the options. |
|---|---|
| Text | The dump in the classic dump_data line format. |
Remarks
The format follows the widely used dump_data/update_info convention: InfoBegin/InfoKey:/InfoValue: blocks for the standard information keys, BookmarkBegin/BookmarkTitle:/BookmarkLevel:/BookmarkPageNumber: blocks for every bookmark in depth-first order, and PageLabelBegin/PageLabelNewIndex:/PageLabelStart:/PageLabelPrefix:/PageLabelNumStyle: blocks for each label range. Values escape &, CR and LF as & .
Edit the text (retitle bookmarks, shift levels, fix metadata) and load it back with ImportDocumentData, on the same document or on a different one — the classic bulk bookmark edit and migration workflow.
Example
Dump:= PDF.ExportDocumentData(2); // bookmarks only
// ... edit the text ...
PDF.ImportDocumentData(Dump, 2);See also
ImportDocumentData, EnumOutlineTree, GetInformation, GetPageLabel