Creating link annotations with text

A: For flexibility, link annotations don’t actually include the text that is shown, but they should be overlaid on top of existing annotations to perform specific actions when clicked (link annotations themselves are invisible).

If you just want to create a regular text link, you should create a link annotation that has the same bounding box as an existing text annotation you created. See an example below:

const uriAction = new PSPDFKit.Actions.URIAction({ uri: "https://pspdfkit.com" })

const linkAnnotation = new PSPDFKit.Annotations.LinkAnnotation({
  pageIndex: existingTextAnnotation.pageIndex,
  boundingBox: existingTextAnnotation.boundingBox,
  action: uriAction,
})

instance.create(linkAnnotation)

Link annotations can also be used for other annotation and action types. Check out the API docs for more information.