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);
int DLGetEmbeddedFileContentToFileA(int InstanceID, int Index, const char* FileName);
Parameters
| Index | The index of the embedded file, from 1 through EmbeddedFileCount |
|---|---|
| FileName | The path and file name of the destination file |
Return values
| 0 | The index is invalid, the destination cannot be created, or decoding failed |
|---|---|
| 1 | The content was written successfully, including a valid empty embedded file |
Remarks
The embedded stream is resolved before creating the destination; an invalid index or missing stream leaves an existing target unchanged and does not create a new file
The source resolver accepts /EF /F and falls back to /EF /UF when no usable legacy stream exists
The extraction path writes decoded Flate content directly to the destination file through bounded chunks, avoiding a second full decoded copy for large attachments