Toolbox add-on Logo
  • pdftools_toolbox
    • pdftools_toolbox.conformance_error
    • pdftools_toolbox.corrupt_error
    • pdftools_toolbox.exists_error
    • pdftools_toolbox.generic_error
    • pdftools_toolbox.geometry
    • pdftools_toolbox.http_error
    • pdftools_toolbox.internal
    • pdftools_toolbox.license_error
    • pdftools_toolbox.not_found_error
    • pdftools_toolbox.operation_error
    • pdftools_toolbox.password_error
    • pdftools_toolbox.pdf
      • pdftools_toolbox.pdf.annotations
      • pdftools_toolbox.pdf.conformance
      • pdftools_toolbox.pdf.content
      • pdftools_toolbox.pdf.copy_strategy
      • pdftools_toolbox.pdf.document
      • pdftools_toolbox.pdf.encryption
      • pdftools_toolbox.pdf.file_reference
      • pdftools_toolbox.pdf.file_reference_list
      • pdftools_toolbox.pdf.forms
      • pdftools_toolbox.pdf.metadata
      • pdftools_toolbox.pdf.name_conflict_resolution
      • pdftools_toolbox.pdf.navigation
        • pdftools_toolbox.pdf.navigation.destination
        • pdftools_toolbox.pdf.navigation.direct_destination
        • pdftools_toolbox.pdf.navigation.embedded_pdf_link
        • pdftools_toolbox.pdf.navigation.fit_height_destination
        • pdftools_toolbox.pdf.navigation.fit_page_destination
        • pdftools_toolbox.pdf.navigation.fit_rectangle_destination
        • pdftools_toolbox.pdf.navigation.fit_width_destination
        • pdftools_toolbox.pdf.navigation.internal_link
        • pdftools_toolbox.pdf.navigation.link
        • pdftools_toolbox.pdf.navigation.link_list
        • pdftools_toolbox.pdf.navigation.location_zoom_destination
        • pdftools_toolbox.pdf.navigation.named_destination
        • pdftools_toolbox.pdf.navigation.named_destination_copy_strategy
        • pdftools_toolbox.pdf.navigation.outline_copy_options
        • pdftools_toolbox.pdf.navigation.outline_item
        • pdftools_toolbox.pdf.navigation.outline_item_list
        • pdftools_toolbox.pdf.navigation.page_display
        • pdftools_toolbox.pdf.navigation.page_layout
        • pdftools_toolbox.pdf.navigation.viewer_navigation_pane
        • pdftools_toolbox.pdf.navigation.viewer_settings
        • pdftools_toolbox.pdf.navigation.web_link
      • pdftools_toolbox.pdf.ocg_state
      • pdftools_toolbox.pdf.optional_content_group
      • pdftools_toolbox.pdf.optional_content_group_list
      • pdftools_toolbox.pdf.page
      • pdftools_toolbox.pdf.page_copy_options
      • pdftools_toolbox.pdf.page_list
      • pdftools_toolbox.pdf.permission
      • pdftools_toolbox.pdf.removal_strategy
      • pdftools_toolbox.pdf.structure
    • pdftools_toolbox.sdk
    • pdftools_toolbox.state_error
    • pdftools_toolbox.string_map
    • pdftools_toolbox.sys
    • pdftools_toolbox.unknown_format_error
    • pdftools_toolbox.unsupported_feature_error
Toolbox add-on
  • pdftools_toolbox
  • pdftools_toolbox.pdf
  • pdftools_toolbox.pdf.navigation
  • pdftools_toolbox.pdf.navigation.embedded_pdf_link
  • View page source

pdftools_toolbox.pdf.navigation.embedded_pdf_link

Classes

EmbeddedPdfLink(handle)

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

Previous Next

© Copyright 2024, PDF Tools AG.

Built with Sphinx using a theme provided by Read the Docs.