annotations

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)
  • Goto URL (set url 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.

    Links, Text, Popup, and FreeText are supported.

    Options In PDF spec Not Implemented Yet

  • 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:
    Name Type Description
    options Object

    (inner) getTextWidth(text) → {number}

    Source:
    Parameters:
    Name Type Description
    text string
    Returns:

    txtWidth

    Type
    number
    Source:

    Create a link

    valid options

  • pageNumber or url [required]

    If pageNumber is specified, top and zoom may also be specified

  • Parameters:
    Name Type Description
    x number
    y number
    w number
    h number
    options Object
    Source:

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

    Parameters:
    Name Type Description
    text string
    x number
    y number
    options Object
    Returns:

    width the width of the text/link

    Type
    number