PdfTocEntry class final
A single entry in the PDF bookmark/outline tree (Table of Contents).
A PDF's "Outline" dictionary is its native Table of Contents structure. Each entry has a title, an optional destination (pageIndex and scrollPosition), and an optional uri for URI-action entries. children holds any nested sub-entries in the same tree shape.
Destination resolution
Bookmark destinations are resolved as follows:
- If the bookmark has a
PDFACTION_GOTOaction, pageIndex is the zero-based page index and scrollPosition is the XYZ anchor (if any). - If the bookmark has a
PDFACTION_URIaction, uri is the URI string and pageIndex isnull. - If neither a matching action nor a direct destination is found, both
pageIndex and uri are
null(section-label entry with no target).
Zoom omission
FPDFDest_GetLocationInPage returns an (x, y, zoom) triple for
PDFDEST_VIEW_XYZ destinations. The zoom value is intentionally not
surfaced here. Exposing zoom risks overriding the user's OS accessibility
zoom settings or Flutter's textScaleFactor, which would create a hostile
experience for users who rely on display magnification. Callers that need
precise magnification control should manage zoom independently of the
bookmark destination. Only the (x, y) scroll anchor is captured via
scrollPosition.
Constructors
-
PdfTocEntry({required String title, int? pageIndex, String? uri, PdfPoint? scrollPosition, List<
PdfTocEntry> children = const []}) -
Creates an immutable PdfTocEntry.
const
Properties
-
children
→ List<
PdfTocEntry> -
The child entries nested under this entry, in document order.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- pageIndex → int?
-
The zero-based page index this entry navigates to, or
nullif the entry has no internal-page destination (e.g. it is a URI action or a section label with no target).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollPosition → PdfPoint?
-
The XYZ scroll anchor within the destination page, or
nullif either the entry has no page destination or the destination does not carry explicit position coordinates.final - title → String
-
The display title of this bookmark entry.
final
- uri → String?
-
The URI this entry navigates to, or
nullif the entry is not a URI action.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override