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 | PDF 名称树中嵌入文件的名称,可通过 GetLoadedEmbeddedFileNames 枚举获取 |
ADestPath | The full disk path where the target file is saved, including filename and extension |
Return value
若找到指定名称的嵌入文件并成功写入磁盘则返回 True,否则返回 False
Usage notes
- 调用此方法前应先通过
GetLoadedEmbeddedFileNames确认文件名存在,传入不存在的名称将返回False - 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