pdftools_toolbox.pdf.navigation.embedded_pdf_link
Classes
|
A link to an embedded PDF document |
- class pdftools_toolbox.pdf.navigation.embedded_pdf_link.EmbeddedPdfLink(handle)[source]
Bases:
Link
A link to an embedded PDF document
- static create(target_document: Document, bounding_box: Rectangle, file_reference: FileReference) → EmbeddedPdfLink[source]
Create a link to an embedded PDF document
The link is associated with the targetDocument but not yet part of any page. It can be added to a page’s list of links.
- Parameters:
targetDocument (pdftools_toolbox.pdf.document.Document) – The output document with which the returned object is associated
boundingBox (pdftools_toolbox.geometry.real.rectangle.Rectangle) – The location on the page
fileReference (pdftools_toolbox.pdf.file_reference.FileReference) – The embedded PDF file
- Returns:
The newly created object
- Return type:
pdftools_toolbox.pdf.navigation.embedded_pdf_link.EmbeddedPdfLink
- Raises:
ValueError – if the targetDocument has already been closed
ValueError – if the targetDocument is read-only
ValueError – if the document associated with the fileReference argument has already been closed
ValueError – if the fileReference argument does not contain a PDF document
ValueError – if the fileReference argument is neither used in a file attachment annotation nor has it been appended to the targetDocument’s list of plain embedded or associated files.
ValueError – if the fileReference argument is used in a file attachment annotation and this annotation has not been appended to a page’s list of annotations.
- static create_from_quadrilaterals(target_document: Document, active_area: QuadrilateralList, file_reference: FileReference) → EmbeddedPdfLink[source]
Create a link to an embedded PDF document with defined link area
The link has an active area defined by the given activeArea. The link is associated with the targetDocument but not yet part of any page. It can be added to a page’s list of links.
- Parameters:
targetDocument (pdftools_toolbox.pdf.document.Document) – The document in which the links is used
activeArea (pdftools_toolbox.geometry.real.quadrilateral_list.QuadrilateralList) – The active link area on the page.
fileReference (pdftools_toolbox.pdf.file_reference.FileReference) – The embedded PDF file
- Returns:
The newly created object
- Return type:
pdftools_toolbox.pdf.navigation.embedded_pdf_link.EmbeddedPdfLink
- Raises:
ValueError – if the targetDocument has already been closed
ValueError – if the targetDocument is read-only
ValueError – if the document associated with the fileReference argument has already been closed
ValueError – if the fileReference argument does not contain a PDF document
ValueError – if the fileReference argument is neither used in a file attachment annotation nor has it been appended to the targetDocument’s list of plain embedded or associated files.
ValueError – if the fileReference argument is used in a file attachment annotation and this annotation has not been appended to a page’s list of annotations.
ValueError – if the activeArea is empty
- property new_window: bool | None
The opening behavior
This defines the viewer’s behavior when opening the target PDF document.
None: The viewer uses its default behavior.
True: Open the document in an additional window.
False: Replace the parent document with the embedded document.
- Returns:
Optional[bool]
- Raises:
StateError – if the object has already been closed