THotPDF.EnsureCollectionRootFolder Method
Creates the portfolio root folder (/Collection /Folders, /Type /Folder with /ID 0) when it is absent, or updates the existing root's name and description. ISO 32000-2, Table 153, defines /Folders as this single indirect root; every other folder hangs off it through /Child and /Next links
Declaration
function EnsureCollectionRootFolder(const RootName: AnsiString= 'Root'; const Description: AnsiString= ''): Integer;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
RootName | Root folder display name, validated as a file name per ISO 32000-2 12.3.5 (1..255 characters, none of / \ : * " < > | nor control characters, no trailing dot); empty keeps the current name or defaults to Root |
Description | Optional description stored as /Desc; empty leaves an existing description untouched |
Return value
The root folder's /ID (0), or -1 when the version lock refuses PDF 1.7
Usage notes
- Requires PDF 1.7; on a 1.7 document the method declares
/Extensions /ADBEwith/ExtensionLevel 3automatically - The root maintains the
/FreeID range that AddCollectionChildFolder draws on when handing out new IDs