pdftools_toolbox.pdf.navigation.web_link
Classes
|
An external link |
- class pdftools_toolbox.pdf.navigation.web_link.WebLink(handle)[source]
Bases:
Link
An external link
- static create(target_document: Document, bounding_box: Rectangle, uri: str) → WebLink[source]
Create an external link
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
boundingBox (pdftools_toolbox.geometry.real.rectangle.Rectangle) – The location on the page.
uri (str) – The link target
- Returns:
The newly created object
- Return type:
- Raises:
ValueError – if the targetDocument argument has already been closed
ValueError – if the targetDocument argument is read-only
ValueError – if the uri is empty
- static create_from_quadrilaterals(target_document: Document, active_area: QuadrilateralList, uri: str) → WebLink | None[source]
Create an external link 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.
uri (str) – The link target
- Returns:
The newly created object
- Return type:
- Raises:
ValueError – if the targetDocument argument has already been closed
ValueError – if the targetDocument argument is read-only
ValueError – if the activeArea is empty
ValueError – if the uri is empty
- property uri: str
The link target
- Returns:
str
- Raises:
StateError – if the object has already been closed