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

NamePurpose
RootNameRoot 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
DescriptionOptional 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

Related APIs