GetDocumentJSON
Document exchange
Description
Returns the complete document object graph as a JSON string
Syntax
Delphi
Function GetDocumentJSON(Options: Integer): WideString;Parameters
| Options | Bit mask controlling the export: 1 omits the data of stream objects, 2 includes the trailer dictionary; 0 exports stream data without the trailer |
|---|
Return values
| Empty string when no document is loaded; otherwise the JSON text |
Remarks
Options follows ExportDocumentJSON: 1 omits stream payloads, 2 includes the trailer dictionary. The returned WideString holds UTF-16 text of the same structure written by ExportDocumentJSON
PDF strings and names preserve their raw byte values: control and high-bit bytes use JSON Unicode escapes. Numbers retain their decimal precision, and the metadata reports the loaded PDF version
Example
JSON:= PDF.GetDocumentJSON(1);