Destinations Reference

class pdfnaut.objects.destinations.Destination[source]

Bases: PdfArray

A explicit destination points to a page within a PDF document with a specified location and zoom factor.

See ISO 32000-2:2020 § 12.3.2 “Destinations” for details.

property args: Sequence[PdfObject]

The arguments provided to the destination, such as coordinates or the zoom factor.

classmethod fit(page: Page) Self[source]

Creates a destination to page with its contents magnified enough to fit the entire page within the window.

classmethod fit_bbox(page: Page) Self[source]

Creates a destination to page with its contents magnified enough to fit the page bounding box.

classmethod fit_bbox_horizontal(page: Page, top: int | float | None = None) Self[source]

Creates a destination to page with its contents magnified enough to fit the entire bounding box of the page within the window horizontally and the top edge of the window positioned at the vertical coordinate top.

classmethod fit_bbox_vertical(page: Page, left: int | float | None = None) Self[source]

Creates a destination to page with its contents magnified enough to fit the entire bounding box of the page within the window vertically and the left edge of the window positioned at the horizontal coordinate left.

classmethod fit_horizontal(page: Page, top: int | float | None = None) Self[source]

Creates a destination to page with its contents magnified enough to fit the entire page within the window horizontally and the top edge of the window positioned at the vertical coordinate top.

classmethod fit_rectangle(page: Page, left: int | float, bottom: int | float, right: int | float, top: int | float) Self[source]

Creates a destination to page with its contents magnified enough to fit the rectangle formed by the coordinates left, bottom, right, and top.

classmethod fit_vertical(page: Page, left: int | float | None = None) Self[source]

Creates a destination to page with its contents magnified enough to fit the entire page within the window vertically and the left edge of the window positioned at the horizontal coordinate left.

property kind: Literal['XYZ', 'Fit', 'FitH', 'FitV', 'FitR', 'FitB', 'FitBH', 'FitBV']

The kind of destination.

property page: Page

The page the destination jumps to.

classmethod xyz(page: Page, left: int | float | None = None, top: int | float | None = None, zoom: int | float | None = None) Self[source]

Creates a coordinate destination to page with the coordinates (left, top) positioned at the upper-left corner of the window and the contents of the page magnified by the specified zoom factor.

Omitting these parameters means that the current value shall remain unchanged.