ComPDFKit Web SDK
    Preparing search index...

    Class Bookmark

    An outline (bookmark) item of the document. Positions are in unrotated page coordinates (top-left origin, PDF points).

    Index
    • Creates a bookmark; bookmarks are normally obtained from Document.getBookmarks.

      Parameters

      • data: BookmarkData

        Outline data read by the Worker.

      • Optionalparent: Bookmark | null

        Parent bookmark, or null for a top-level item.

      • Optionalindex: number

        Index among sibling bookmarks (0-based).

      Returns Bookmark

    • Action of the target: GoTo for in-document targets, URI for links

      Returns Action[]

    • Action type: /S of /A in the file (GoTo, GoToR, Launch, Named, URI, JavaScript and so on, as is); GoTo for items with only /Dest (including named destinations); an empty string without an action. When the file info cannot be read, by the engine type: GoTo for in-document targets, URI for links, an empty string otherwise (the engine reports all other actions as none)

      Returns string

    • Returns the child bookmarks.

      Returns Bookmark[]

      A new array of the children, in order.

    • Color of the outline item (/C, 0–1); undefined when missing or black (all 0)

      Returns { b: number; g: number; r: number } | undefined

      • { b: number; g: number; r: number }
        • b: number

          Blue, 0 to 1.

        • g: number

          Green, 0 to 1.

        • r: number

          Red, 0 to 1.

      • undefined
    • The target position read by the engine, in PDF coordinates (bottom-left origin, not converted); given even when the target page no longer exists. null without an in-document target; a dimension is null when missing (/Fit and similar types, or null)

      Returns { x: number | null; y: number | null } | null

      • { x: number | null; y: number | null }
        • x: number | null

          Horizontal position in PDF coordinates; null when missing.

        • y: number | null

          Vertical position in PDF coordinates; null when missing.

      • null
    • x of the target position (page coordinates, pt)

      Returns number

    • Index among sibling bookmarks (0-based)

      Returns number

    • Returns the title.

      Returns string

      The bookmark title.

    • Object number of the outline item in the file (undefined when it cannot be read for encrypted documents)

      Returns number | undefined

    • Target page (1-based); 0 without an in-document target (such as a link)

      Returns number

    • Returns the parent bookmark.

      Returns Bookmark | null

      The parent, or null for a top-level item.

    • Address of a link bookmark; an empty string for others

      Returns string

    • y of the target position (page coordinates, top-left origin, pt)

      Returns number

    • Has an in-document target or a link address

      Returns boolean

    data: BookmarkData

    Outline data read by the Worker.

    parent: Bookmark | null

    Parent bookmark, or null for a top-level item.