The Destination Class

class pypdf.generic.Destination(title: str, page: Union[NumberObject, IndirectObject, NullObject, DictionaryObject], fit: Fit)[source]

Bases: TreeObject

A class representing a destination within a PDF file.

See section 8.2.1 of the PDF 1.6 reference.

Parameters
  • title – Title of this destination.

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

  • fit – How the destination is displayed.

Raises

PdfReadError – If destination type is invalid.

node: Optional[pypdf.generic._data_structures.DictionaryObject] = None
childs: List[Any] = []
property dest_array: pypdf.generic._data_structures.ArrayObject
getDestArray() ArrayObject[source]

Use dest_array instead.

Deprecated since version 1.28.3.

write_to_stream(stream: IO, encryption_key: Union[None, str, bytes]) None[source]
property title: Optional[str]

Read-only property accessing the destination title.

property page: Optional[int]

Read-only property accessing the destination page number.

property typ: Optional[str]

Read-only property accessing the destination type.

property zoom: Optional[int]

Read-only property accessing the zoom factor.

property left: Optional[pypdf.generic._base.FloatObject]

Read-only property accessing the left horizontal coordinate.

property right: Optional[pypdf.generic._base.FloatObject]

Read-only property accessing the right horizontal coordinate.

property top: Optional[pypdf.generic._base.FloatObject]

Read-only property accessing the top vertical coordinate.

property bottom: Optional[pypdf.generic._base.FloatObject]

Read-only property accessing the bottom vertical coordinate.

property color: Optional[pypdf.generic._data_structures.ArrayObject]

Read-only property accessing the color in (R, G, B) with values 0.0-1.0.

property font_format: Optional[pypdf.constants.OutlineFontFlag]

Read-only property accessing the font type.

1=italic, 2=bold, 3=both

property outline_count: Optional[int]

Read-only property accessing the outline count.

positive = expanded negative = collapsed absolute value = number of visible descendents at all levels