GetAnnotEmbeddedFileToFile
Annotations and hotspot links
Description
Saves the embedded file inside the annotation object to the specified file on disk
Syntax
Delphi
Function TPDFlib.GetAnnotEmbeddedFileToFile(Index, Options: Integer; Const FileName: WideString): Integer;
ActiveX
Function PDFlib::GetAnnotEmbeddedFileToFile(Index As Long, Options As Long, FileName As String) As Long
DLL
int DLGetAnnotEmbeddedFileToFile(int InstanceID, int Index, int Options, const wchar_t* FileName);
int DLGetAnnotEmbeddedFileToFileA(int InstanceID, int Index, int Options, const char* FileName);
Parameters
| Index | The 1-based annotation index on the selected page |
|---|---|
| Options | Reserved; pass 0 |
| FileName | The destination file path |
Return values
| 1 | The attachment was written successfully, including a valid empty attachment |
|---|---|
| 0 | The annotation has no embedded stream, the index is invalid, or file creation, decoding or writing failed |
Remarks
The embedded stream is resolved before creating the destination; an invalid index or missing stream leaves existing target data unchanged
The export writes decoded stream data directly instead of first building a complete decoded string; supported Flate streams use bounded chunks, and incomplete writes fail the export