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
| Name | Purpose |
|---|---|
ParentFolderID | /ID of the parent folder; 0 picks the root created by EnsureCollectionRootFolder |
FolderName | Folder 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 |
Description | Optional 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
- Requires PDF 1.7; on a 1.7 document the portfolio extension features declare
/Extensions /ADBEwith/ExtensionLevel 3automatically - Sibling order follows SetPortfolioSortOrder: folders are compared by the schema fields of their
/CImetadata (numbers numerically, text with case folded), folders missing a value sort last, and ties fall back to the name with case folded - The name parameters are AnsiString in the host code page; characters the host page cannot represent are stored as
?