SetCollectionItemFolder
Attachments, Document properties
Description
Moves an embedded file into a portfolio folder, or back to the top level
Syntax
Delphi
Function TPDFlib.SetCollectionItemFolder(Const FileName, FolderPath: WideString): Integer;Parameters
| FileName | The name the file was registered under with AddFileAttachment |
|---|---|
| FolderPath | An existing folder path such as Contracts/2026, or an empty string for the top level |
Return values
| 0 | The file or the folder does not exist, or the folder already holds a file of the same name |
|---|---|
| 1 | The file is in the folder |
Remarks
A file is placed in a folder by prefixing its name in the embedded files list with the folder ID in angle brackets, such as <3>contract.pdf. The functions that take a file name, including SetCollectionItemValue, still accept the plain name
Example
PDF.AddCollectionFolder('Contracts/2026');
PDF.SetCollectionItemFolder('contract.pdf', 'Contracts/2026');