The Destination Class

class PyPDF2.generic.Destination(title, page, typ, *args)[source]

Bases: PyPDF2.generic.TreeObject

A class representing a destination within a PDF file. See section 8.2.1 of the PDF 1.6 reference.

Parameters
  • title (str) – Title of this destination.

  • page (IndirectObject) – Reference to the page of this destination. Should be an instance of IndirectObject.

  • typ (str) – How the destination is displayed.

  • args – Additional arguments may be necessary depending on the type.

Raises

PdfReadError – If destination type is invalid.

Valid typ arguments (see PDF spec for details)

/Fit

No additional arguments

/XYZ

[left] [top] [zoomFactor]

/FitH

[top]

/FitV

[left]

/FitR

[left] [bottom] [right] [top]

/FitB

No additional arguments

/FitBH

[top]

/FitBV

[left]

property bottom

Read-only property accessing the bottom vertical coordinate.

Return type

int, or None if not available.

property dest_array
getDestArray()[source]

Deprecated since version 1.28.3: Use dest_array instead.

property left

Read-only property accessing the left horizontal coordinate.

Return type

int, or None if not available.

property page

Read-only property accessing the destination page number.

Return type

int

property right

Read-only property accessing the right horizontal coordinate.

Return type

int, or None if not available.

property title

Read-only property accessing the destination title.

Return type

str

property top

Read-only property accessing the top vertical coordinate.

Return type

int, or None if not available.

property typ

Read-only property accessing the destination type.

Return type

str

write_to_stream(stream, encryption_key)[source]
property zoom

Read-only property accessing the zoom factor.

Return type

int, or None if not available.