Back to Jspdf

annotations

docs/module-annotations.html

4.2.12.1 KB
Original Source

jsPDF Annotations PlugIn

There are many types of annotations in a PDF document. Annotations are placed on a page at a particular location. They are not 'attached' to an object.
This plugin current supports

  • Goto Page (set pageNumber and top in options)

  • Goto Name (set name and top in options)

  • The destination magnification factor can also be specified when goto is a page number or a named destination. (see documentation below) (set magFactor in options). XYZ is the default.

  • link border

  • named target

  • page coordinates

  • destination page scaling and layout

  • actions other than URL and GotoPage

  • background / hover actions

Source:

Methods

(inner) createAnnotation(options)

Source:

Parameters:
NameTypeDescription
optionsObject

(inner) getTextWidth(text) → {number}

Source:

Parameters:
NameTypeDescription
textstring
Returns:

txtWidth

Type number

(inner) link(x, y, w, h, options)

Source:

Create a link

valid options

  • If pageNumber is specified, top and zoom may also be specified
Parameters:
NameTypeDescription
xnumber
ynumber
wnumber
hnumber
optionsObject

(inner) textWithLink(text, x, y, options) → {number}

Source:

Currently only supports single line text. Returns the width of the text/link

Parameters:
NameTypeDescription
textstring
xnumber
ynumber
optionsObject
Returns:

width the width of the text/link

Type number