GetXRefDiagnostics
Document management, Diagnostics, Recovery
Description
Returns a JSON report for the cross-reference and recovery path used to load the selected document
Syntax
Delphi
Function TPDFlib.GetXRefDiagnostics: WideString;Return values
| Empty string | No loaded document is selected and LastErrorCode is set to 401 |
|---|---|
| JSON report | The report was returned |
Report fields
| File positions | fileSize, headerOffset, startXRefTokenOffset, declaredStartXRef, effectiveStartXRef, eofOffset and trailingBytes |
|---|---|
| Cross-reference summary | policy is strict, compatible or recovery; xrefType is table, stream, hybrid, mixed or unknown; hasXRefStream, hybrid, shiftedHeader, sectionCount and trailerCount describe the selected chain |
| Entry counts | entries reports allocated slots and free, in-use, compressed and invalid entries |
| Decisions | decisions reports selected chain types, followed links, compatibility repairs and rejected sections in evaluation order |
| Sections | Each item reports declared and physical offsets, table or stream type, startxref, prev or xrefstm source, inclusive trailer dictionary boundaries, linked offsets, parse attempt, compatibilityFlags and success state |
| Recovery | recovery reports strict, repair or best-effort mode, whether fallback was attempted and succeeded, recovered object counts, the trailer source and ordered decisions |
Remarks
All byte positions are zero-based; unavailable positions are reported as -1
A shifted-header retry remains visible as attempt 2 so the declared and effective positions can be compared without hiding the failed first attempt
Recovery decisions can include raw-object-scan, recover-object-stream-members and synthesize-trailer