SetCollectionItemFolder
附件、文件屬性
描述
將內嵌檔案移入 portfolio 資料夾,或移回頂層
語法
Delphi
Function TPDFlib.SetCollectionItemFolder(Const FileName, FolderPath: WideString): Integer;參數
| FileName | 檔案以 AddFileAttachment 註冊時所用的名稱 |
|---|---|
| FolderPath | 既有的資料夾路徑,例如 Contracts/2026,或以空字串表示頂層 |
傳回值
| 0 | 檔案或資料夾不存在,或資料夾中已有同名檔案 |
|---|---|
| 1 | 檔案已在資料夾中 |
備註
檔案放入資料夾的方式,是在內嵌檔案清單中於其名稱前加上角括號包住的資料夾 ID,例如 <3>contract.pdf。接受檔案名稱的函式(包括 SetCollectionItemValue)仍然接受原始名稱
範例
PDF.AddCollectionFolder('Contracts/2026');
PDF.SetCollectionItemFolder('contract.pdf', 'Contracts/2026');