## PDF Annotations

createPdfAnnotation(...)
  `createPdfAnnotation(type, x, y, w, h, ["name"]) -> string`

  Creates a new PDF Annotation frame. "type" refers to the kind of PDF annotation with the following key:

  - 0 - PDFBUTTON
  - 1 - PDFRADIOBUTTON
  - 2 - PDFTEXTFIELD
  - 3 - PDFCHECKBOX
  - 4 - PDFCOMBOBOX
  - 5 - PDFLISTBOX
  - 6 - PDFTEXTANNOTATION
  - 7 - PDFLINKANNOTATION
  - 8 - PDF3DANNOTATION.

  x and y are the upper left coordinates for the frame, having w width and h height. If "name" is not given Scribus will create one for you.

  On systems without OSG installed a runtime error will be raised. May raise NameExistsError if you explicitly pass a name that's already used.

getJSActionScript(...)
  `getJSActionScript(which, ["name"]) -> string`

  Gets the JavaScript action script for a particular event

  This functions accepts following arguments:

  - which is an integer in range 0-9 describing the kind of event:
  - 0 - Mouse Up
  - 1 - Mouse Down
  - 2 - Mouse Enter
  - 3 - Mouse Exit
  - 4 - Focus In
  - 5 - Focus Out
  - 6 - Selection Change
  - 7 - Field Format
  - 8 - Field Validate
  - 9 - Field Calculate
  - name is the object name. If "name" is not provided, the currently selected item will be used.

  Returns a string if object's action type is Javascript, NONE otherwise.

  Page item must be an annotation or an error will be raised. May raise NameExistsError if you explicitly pass a name that doesn't exist.

isAnnotated(...)
  `isAnnotated(["name"], ["deannotate=False"]) -> tuple`

  Queries whether the named or selected object is a PDF annotation. Returns NONE if it is not. If deannotate=True is included, turns off PDF annotation flag and returns NONE. If frame is annotation, first value of tuple is type, and second is any additional information obtainable.

  May raise WrongFrameTypeError if object is not a text frame.

setFileAnnotation(...)
  `setFileAnnotation(path, page, x, y, ["name"], ["absolute=True"])`

  Converts a text frame to a PDF link annotation to a file. path is the absolute or relative path to the file. page is the page in the document to link to, and x and y are the page coordinates. The currently selected frame will be converted unless another name is given. The default value for absolute is True, which means the path is absolute; if set to False the path is relative.

  May raise NameExistsError if you explicitly pass a name that doesn't exist. May raise WrongFrameTypeError if object is not a text frame.

setJSActionScript(...)
  `setJSActionScript(which, script, ["name"]) -> string`

  Sets the JavaScript action for a particular event and returns NONE.

  Also sets the annotation's action to JavaScript.

  This functions accepts following arguments:

  - which is an integer in range 0-9 describing the kind of event:
  - 0 - Mouse Up
  - 1 - Mouse Down
  - 2 - Mouse Enter
  - 3 - Mouse Exit
  - 4 - Focus In
  - 5 - Focus Out
  - 6 - Selection Change
  - 7 - Field Format
  - 8 - Field Validate
  - 9 - Field Calculate
  - script is the JavaScript to set to the action
  - name is the object name. If "name" is not provided, the currently selected item will be used.

  Page item must be an annotation or an error will be raised. May raise NameExistsError if you explicitly pass a name that doesn't exist.

setLinkAnnotation(...)
  `setLinkAnnotation(page, x, y, ["name"])`

  Converts a text frame to a PDF link annotation to a page in the current document. page is the page in the document to link to, and must be in the range of pages, starting with 1. x and y are the page coordinates. The currently selected frame will be converted unless another name is given.

  May raise NameExistsError if you explicitly pass a name that doesn't exist. May raise WrongFrameTypeError if object is not a text frame.

setTextAnnotation(...)
  `setTextAnnotation(icon, isopen, ["name"])`

  Converts a text frame to a text annotation. Function accepts following arguments:

  - icon is a number in range 0-8 with the following key:
  - 0 = Note
  - 1 = Comment
  - 2 = Key
  - 3 = Help
  - 4 = NewParagraph
  - 5 = Paragraph
  - 6 = Insert
  - 7 = Cross
  - 8 = Circle
  - isopen is either True or False.

  The currently selected frame will be converted unless another name is given.

  May raise NameExistsError if you explicitly pass a name that doesn't exist. May raise WrongFrameTypeError if object is not a text frame.

setURIAnnotation(...)
  `setURIAnnotation(uri, ["name"])`

  Converts a text frame to a PDF URI link annotation. uri is the uri to link to. The currently selected frame will be converted unless another name is given.

  May raise NameExistsError if you explicitly pass a name that doesn't exist. May raise WrongFrameTypeError if object is not a text frame.