GetEmbeddedFileContentToStream

Document properties

Description

Extracts the specified embedded file and writes the content to the specified stream.

Syntax

Delphi

Function TPDFlib.GetEmbeddedFileContentToStream(Index: Integer; OutStream: TStream): Integer;

Parameters

IndexThe index of the embedded file, from 1 through EmbeddedFileCount
OutStreamThe target stream that receives the decoded content

Return values

0The index is invalid, the target is unavailable, or decoding failed
1The content was written successfully, including a valid empty embedded file

Remarks

Embedded files stored through a single Flate filter without a predictor are decoded directly to OutStream through bounded chunks, avoiding a second full decoded copy for large attachments

More complex filter chains retain their established decoding behavior and are then copied to the target stream