GetEmbeddedFileContentToFile

Document properties

Description

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

Syntax

Delphi

Function TPDFlib.GetEmbeddedFileContentToFile(Index: Integer; Const FileName: WideString): Integer;

ActiveX

Function PDFlib::GetEmbeddedFileContentToFile(Index As Long, FileName As String) As Long

DLL

int DLGetEmbeddedFileContentToFile(int InstanceID, int Index, const wchar_t * FileName);

Parameters

IndexThe index of the embedded file, from 1 through EmbeddedFileCount
FileNameThe path and file name of the destination file

Return values

0The index is invalid, the destination cannot be created, or decoding failed
1The content was written successfully, including a valid empty embedded file

Remarks

The extraction path writes decoded Flate content directly to the destination file through bounded chunks, avoiding a second full decoded copy for large attachments