documentation.HELP! PyMuPDF Documentation

Link

PyMuPDF

previous page next page

Navigation

  • index
  • next |
  • previous |
  • PyMuPDF 1.12.2 documentation »
  • Classes »

Link

Represents a pointer to somewhere (this document, other documents, the internet). Links exist per document page, and they are forward-chained to each other, starting from an initial link which is accessible by the Page.firstLink property.

There is a parent-child relationship between a link and its page. If the page object becomes unusable (closed document, any document structure change, etc.), then so does every of its existing link objects - an exception is raised saying that the object is “orphaned”, whenever a link property or method is accessed.

Attribute Short Description
Link.rect clickable area in untransformed coordinates.
Link.uri link destination
Link.isExternal external link destination?
Link.next points to next link
Link.dest points to link destination details

Class API

class Link
rect

The area that can be clicked in untransformed coordinates.

Type:Rect
isExternal

A bool specifying whether the link target is outside of the current document.

Type:bool
uri

A string specifying the link target. The meaning of this property should be evaluated in conjunction with property isExternal. The value may be None, in which case isExternal == False. If uri starts with file://, mailto:, or an internet resource name, isExternal is True. In all other cases isExternal == False and uri points to an internal location. In case of PDF documents, this should either be #nnnn to indicate a 1-based (!) page number nnnn, or a named location. The format varies for other document types, e.g. uri = '../FixedDoc.fdoc#PG_2_LNK_1' for page number 2 (1-based) in an XPS document.

Type:str
next

The next Link or None

Type:Link
dest

The link destination details object.

Type:linkDest

Navigation

  • index
  • next |
  • previous |
  • PyMuPDF 1.12.2 documentation »
  • Classes »
© Copyright 2015-2018, Jorj X. McKie. Last updated on 13. Jan 2018. Created using Sphinx 1.6.6.
previous page start next page

Menu

  • Homepage

Table of contents

  • PyMuPDF 1.12.2 documentation
  • Introduction
    • Note on the Name fitz
    • License
    • Covered Version
  • Installation
    • Option 1: Install from Sources
      • Step 1: Download PyMuPDF
      • Step 2: Download and Generate MuPDF
      • Step 3: Build / Setup PyMuPDF
    • Option 2: Install from Binaries
      • Step 1: Download Binary
      • Step 2: Install PyMuPDF
      • MD5 Checksums
      • Targeting Parallel Python Installations
    • Using UPX
  • Tutorial
    • Importing the Bindings
    • Opening a Document
    • Some Document Methods and Attributes
    • Accessing Meta Data
    • Working with Outlines
    • Working with Pages
      • Inspecting the Links of a Page
      • Rendering a Page
      • Saving the Page Image in a File
      • Displaying the Image in Dialog Managers
      • Extracting Text
      • Searching Text
    • PDF Maintenance
      • Modifying, Creating, Re-arranging and Deleting Pages
      • Joining and Splitting PDF Documents
      • Saving
    • Closing
    • Example: Dynamically Cleaning up Corrupt PDF Documents
    • Further Reading
  • Classes
    • Annot
      • Example
    • Colorspace
    • Document
      • Remarks on select()
      • select() Examples
      • setMetadata() Example
      • setToC() Example
      • insertPDF() Examples
      • Other Examples
    • Identity
    • IRect
      • Remark
      • IRect Algebra
      • Examples
    • Link
    • linkDest
    • Matrix
      • Remarks 1
      • Remarks 2
      • Matrix Algebra
      • Examples
      • Shifting
      • Flipping
      • Shearing
      • Rotating
    • Outline
    • Page
      • Description of getLinks() Entries
      • Notes on Supporting Links
        • Reading (pertains to method getLinks() and the firstLink property chain)
        • Writing
      • Homologous Methods of Document and Page
    • Pixmap
      • Supported Input Image Types
      • Details on Saving Images with writeImage()
      • Pixmap Example Code Snippets
    • Point
      • Remark
      • Point Algebra
      • Examples
    • Shape
      • Usage
        • Notes
      • Examples
      • Common Parameters
    • Rect
      • Remark
      • Rect Algebra
      • Examples
  • Operator Algebra for Geometry Objects
    • General Remarks
    • Unary Operations
    • Binary Operations
  • Low Level Functions and Classes
    • Functions
    • Device
    • DisplayList
    • TextPage
      • Structure of TextPage.extractJSON()
        • Page Dictionary
        • Block Dictionaries
        • Line Dictionary
        • Span Dictionary
      • Full Document Output in JSON Format
    • Working together: DisplayList and TextPage
      • Create a DisplayList
      • Generate Pixmap
      • Perform Text Search
      • Extract Text
      • Further Performance improvements
        • Pixmap
        • TextPage
  • Constants and Enumerations
    • Constants
    • Font File Extensions
    • Text Alignment
    • Preserve Text Flags
    • Link Destination Kinds
    • Link Destination Flags
    • Annotation Types
    • Annotation Flags
    • Annotation Line End Styles
  • Color Database
    • Function getColor()
    • Printing the Color Database
  • Appendix 1: Performance
    • Part 1: Parsing
    • Part 2: Text Extraction
    • Part 3: Image Rendering
  • Appendix 2: Details on Text Extraction
    • General structure of a TextPage
    • Plain Text
    • HTML
    • Controlling Quality of HTML Output
    • JSON
    • XML
    • XHTML
    • Further Remarks
    • Performance
  • Appendix 3: Considerations on Embedded Files
    • General
    • MuPDF Support
    • PyMuPDF Support
  • Appendix 4: Assorted Technical Information
    • PDF Base 14 Fonts
    • Adobe PDF Reference 1.7
    • Ensuring Consistency of Important Objects in PyMuPDF
    • Design of Method Page.showPDFpage()
      • Purpose and Capabilities
      • Technical Implementation
  • Change Logs
    • Changes in Version 1.12.2
    • Changes in Version 1.12.1
    • Changes in Version 1.12.0
    • Changes in Version 1.11.2
    • Changes in Version 1.11.1
    • Changes in Version 1.11.0
    • Changes in Version 1.10.0
      • MuPDF v1.10 Impact
      • Other Changes compared to Version 1.9.3
    • Changes in Version 1.9.3
    • Changes in Version 1.9.2
    • Changes in Version 1.9.1
  • Error Messages

Get in touch

Submit feedback about this site to:

  • [email protected]

© documentation.help. Design: rehmann.co.