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 inserted among its siblings in the collection sort order, or by case-folded name 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 selects the root created by EnsureCollectionRootFolder
FolderNameFolder display name, a file name per ISO 32000-2 12.3.5: 1..255 characters, none of / \ : * " < > | or control characters, no trailing dot. Stored as a PDF text string (UTF-16BE when 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 assigned to the new folder, suitable as ParentFolderID for deeper levels and as FolderID for AddDocumentAttachmentToCollectionFolder

Usage notes

Related APIs