THotPDF.AddCollectionChildFolder Method

Adds a child folder to a portfolio folder tree node (ISO 32000-2, Table 159, /Type /Folder with /ID, /Name, /Parent, /Child and /Next links). The new folder is slotted in amongst its siblings in the collection sort order, or by name with case folded when no /Sort is set

Declaration

function AddCollectionChildFolder(ParentFolderID: Integer; const FolderName: AnsiString; const Description: AnsiString= ''): Integer;

Unit

HPDFDoc

Parameters

NamePurpose
ParentFolderID/ID of the parent folder; 0 picks the root created by EnsureCollectionRootFolder
FolderNameFolder display name, a file name per ISO 32000-2 12.3.5: 1..255 characters, none of / \ : * " < > | nor control characters, no trailing dot. Stored as a PDF text string (UTF-16BE where the host code page needs it). A sibling whose name matches after full UAX #21 case folding is refused, so Straße and STRASSE cannot coexist
DescriptionOptional folder description stored as /Desc

Return value

The /ID handed to the new folder, suitable as ParentFolderID for deeper levels and as FolderID for AddDocumentAttachmentToCollectionFolder

Usage notes

Related APIs