THotPDF.SetPDFVTNodePages Method
Gives a leaf node of the PDF/VT document part hierarchy its inclusive range of pages, written as the /Start and /End entries of that node's DPart dictionary, so a consumer can find each record's pages without walking the hierarchy
Declaration
procedure SetPDFVTNodePages(Node, FirstPage, LastPage: Integer);
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Node | The handle AddPDFVTNode returned for the leaf |
FirstPage | First page of the range, 1-based, written as /Start |
LastPage | Last page of the range, written as /End, which is omitted when it equals FirstPage |
Usage notes
- ISO 16612-2:2010 §6.5 Table 4 defines
/Startand/Endas the first and last page of the range, and a single-page leaf simply omits/End, which is what this method writes - Pages are 1-based here, so the first page of the document is 1; a
FirstPagebelow 1 or aLastPagebeforeFirstPageraises - Only a leaf node takes a range: a node that already has children refuses one, because Table 4 makes
/DPartsand/Startmutually exclusive, and a node that already carries a range refuses a second one, because a DPart dictionary holds one range EndDocchecks the whole covering rather than each call on its own: every page of the document has to fall inside exactly one leaf range, a range that reaches past the last page raises, and a node with neither children nor a range raises because it could not cover the pages the file has to placeEndDocalso checks the order, since §6.5 requires the page-tree order to match the order in which a depth-first traversal of the hierarchy reaches the leaf DPart dictionaries; a gap, an overlap or an out-of-order declaration raises there- Each page then carries a
/DPartkey referencing the leaf whose range includes it, which §6.5 requires of every Page object in a PDF/VT file