THotPDF.SaveLoadedEmbeddedFileToDisk Method
Extracts the embedded attachment with the specified name from the loaded PDF document and saves it to a disk path
Declaration
function SaveLoadedEmbeddedFileToDisk(const AFileName: AnsiString; const ADestPath: AnsiString): boolean;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
AFileName | Name of the embedded file in the PDF name tree, obtainable via GetLoadedEmbeddedFileNames |
ADestPath | The full disk path where the target file is saved, including filename and extension |
Return value
Returns True when the named embedded file is found and written to disk successfully
Usage notes
- Call GetLoadedEmbeddedFileNames first to obtain the valid embedded file names
- The directory where the target path resides must exist and have write permissions, otherwise the method will fail; the method will not automatically create intermediate directories
- If a file with the same name already exists at the target path, the method will overwrite it; please perform backups or path checks before calling