GetNamedPage

Page properties

Description

Resolves a name in the catalog /Names /Pages name tree to its page number

Syntax

Delphi

Function GetNamedPage(Const PageName: WideString): Integer;

Parameters

PageNameName previously registered for a page or read from the document name tree

Return values

0No selected document, empty or unknown name, missing /Names /Pages tree, non-page target or unresolved page reference
NOne-based page number for the named page

Remarks

The lookup resolves the name-tree value to a page dictionary and then matches that dictionary by identity against the current page tree

Page names are distinct from named destinations

Example

PageNumber:= PDF.GetNamedPage("Appendix");
if PageNumber= 0 then Log("Named page was not found");

See also

AddNamedPage, GetNamedDestination, GetPagePieceInfo