GetImageDeduplicationReportJSON
Image handling, optimisation, diagnostics
Description
Builds a read-only manifest of byte-identical image XObjects that can be consolidated by DeduplicateResources
The manifest groups images by a SHA-256 digest over the canonical image dictionary and encoded payload, records every indirect object and generation number, reports the pages that reach each image through nested Form XObjects, and estimates reclaimable encoded payload bytes
Syntax
Delphi
Function TPDFlib.GetImageDeduplicationReportJSON(Out Report: WideString): Integer;DLL
const wchar_t* DLGetImageDeduplicationReportJSON(int InstanceID);ActiveX
Function PDFlib::GetImageDeduplicationReportJSON() As StringReturn values
The Delphi method returns the number of duplicate groups and writes the JSON document to Report
The DLL and ActiveX methods return the JSON document directly
JSON fields
| candidateImages | Number of indirect image streams hashed during the dry run |
|---|---|
| duplicateImages | Number of image objects that can be repointed to a canonical object |
| groupCount | Number of duplicate groups |
| crossPageGroupCount | Groups used by more than one page |
| reclaimableBytes | Total duplicate encoded payload bytes |
| groups | Digest, payload size, cross-page state, and member objects with one-based page arrays |
Remarks
The scan never rewrites references or removes objects
Dictionary key order and indirect /Length storage do not create false differences, while decoding parameters, colour spaces, masks, interpolation, and other semantic dictionary differences remain distinct