pdftools_toolbox.pdf.navigation.named_destination
Classes
|
A named destination that can be referred by name. |
- class pdftools_toolbox.pdf.navigation.named_destination.NamedDestination(handle)[source]
Bases:
Destination
A named destination that can be referred by name. Named destinations have two advantages compared to direct destinations:
The name can be used in web links, e.g. http://www.example.com/document.pdf#destinationname
If the target destination of a named destination is changed, all occurrences automatically point ot the new target.
- static create(target_document: Document, name: str, target: DirectDestination) → NamedDestination[source]
Create a named destination
The returned object is not yet used on any page, but it is associated with the given target document.
- Parameters:
targetDocument (pdftools_toolbox.pdf.document.Document) – The output document with which the returned object is associated
name (str) – The name by which the destination is referred to.
target (pdftools_toolbox.pdf.navigation.direct_destination.DirectDestination) – The target destination
- Returns:
The newly created named destination.
- Return type:
pdftools_toolbox.pdf.navigation.named_destination.NamedDestination
- Raises:
ValueError – if the targetDocument argument has already been closed
ValueError – if the targetDocument argument is read-only
ValueError – if the document associated with the target argument has already been closed
ValueError – if the target argument belongs to a different document
- property name: str
The name by which the destination is referred to.
- Returns:
str
- Raises:
StateError – the object has already been closed.
StateError – the associated document has already been closed.