# 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:
  - modules/annotations.js, line 9

### Methods

#### (inner) createAnnotation(options)

Source:
  - modules/annotations.js, line 292

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object |

#### (inner) getTextWidth(text) → {number}

Source:
  - modules/annotations.js, line 392

##### Parameters:

Name | Type | Description
--- | --- | ---
`text` | string |

##### Returns:

txtWidth

Type
  number

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

Source:
  - modules/annotations.js, line 316

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 |

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

Source:
  - modules/annotations.js, line 347

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