PDFium Delphi Component Docs

SaveAsInlineImagesExternalised method

Component: TPdf  ·  Unit: PDFium
Rewrites the document extracting every BI/ID/EI inline image into a reusable image XObject and replacing each inline block with a /ImN Do operator

Syntax

function SaveAsInlineImagesExternalised(Stream: TStream; const Options: TPdfInlineImageExternaliseOptions; out Report: TPdfInlineImageExternaliseReport; AllowSignedDocument: Boolean = False): Boolean;

function SaveAsInlineImagesExternalised(const FileName: string; const Options: TPdfInlineImageExternaliseOptions; out Report: TPdfInlineImageExternaliseReport; AllowSignedDocument: Boolean = False): Boolean;

Description

Each page content stream is decoded and scanned for inline images; every BI/ID/EI block is extracted into a new image XObject indirect object

Inline-image dictionary abbreviations (/W, /H, /BPC, /CS, /F, colour-space and filter value abbreviations) are expanded to their full image-XObject names so the extracted object is standards-compliant

The inline block in the content stream is replaced by /ImN Do, the page /Resources /XObject dictionary is updated with the new reference, and the rewritten content stream is Flate-compressed

Object numbers and generations of existing objects stay stable; new image XObjects and content streams are appended

Policies and limits

Example

Options.SkipUnsafePages:= True;
Pdf.SaveAsInlineImagesExternalised('externalised.pdf', Options, Report);
WriteLn('externalised ', Report.ExternalisedCount, ' inline images');

See Also

SaveAsReachable, SaveAsDeduplicated, SaveAs