SDK Samples

One-Step Link

Add a visible, clickable link in a single guided action. The Add Link button prompts for text, color, and URL, then a single click on the page creates both the text label and the link annotation together.

How this works

A PDF LinkAnnotation is only an invisible clickable hotspot — it renders no text of its own. Showing visible, clickable link text normally takes two steps: create a text annotation, then draw a link over it. This sample fuses both into one action: the Add Link button collects the text, color, and URL, and a single instance.create([...]) call adds a TextAnnotation (the visible label) and a LinkAnnotation (a URIAction) sharing one bounding box.

Loading document viewer...