Skip to main content

Attach URI Annotation Node (Tagging)

What it does

This node attaches URI annotations to the specified items of your document, making elements function as clickable hyperlinks. These annotations enhance both interactivity and accessibility, allowing users to navigate to external resources directly from the PDF.

Use it for

  • Making links in your document interactive and accessible.
  • Dynamically defining the URI and content of hyperlinks based on document data.

How to use it

  1. Drag and drop the node from the Node Library into your template:
    Node Library > Folder Tagging
  2. Connect the node with other nodes in the Data Flow of your template. 
  3. Specify the settings in the Node Properties task pane.

Tip

To ensure proper tagging and accessibility, the URI annotation and its linked content should be nested within a Link structure element. Use the Attach Structure Element Node to add a Link tag around the annotated content.

Node Input

Connect a node containing the items (shape trees) where you want to insert hyperlinks to the Items input port.

Node Output

Outputs the original items with attached URI annotations in the Items output port.

Note

These annotations do not appear in the Node Result task pane. To verify the result, preview the PDF in a PDF Viewer.

Node Properties

Node Name

You can assign a custom name to the node to help identify its purpose within your template.


URI Expression

Define the destination URI of the hyperlink. You can enter a static string or use an expression to generate the URI dynamically.

Available variables:

  • item: the current shape tree item being processed from the input list. item has the same properties as a shape tree object.
  • index: the zero-based index of the item in the input list
  • first: the first item in the input list
  • last: the last item in the input list
  • prev: the previous item in the input list. prev has the same properties as a shape tree object.
  • next: the next item in the input list. next has the same properties as a shape tree object.
  • count: the total number of items in the input list

Expected return type: string

Example 1:

"https://www.example.com/page"

Static string with the URI.

Example 2:

item.text match "^http" ? item.text : 
"@" in item.text ? ("mailto:" concat item.text):
("https://" concat item.text)

If the text of the input item starts with "http", use the text as the URI.
Else, if the text contains "@", prepend "mailto:" to the text.
Else, prepend "https://" to the text.

Example 3:

first ? "https://www.example.com/page" : 
index = 3 ? "mailto:office@example.com":
item.text

If the current item is the first in the sequence, use "https://www.example.com/page" as the URI.
If the current item is the fourth in the sequence, use "mailto:office@example.com" as the URI.
Otherwise, use the item’s text as the URI.


Line Selector

Use Path Language to specify the exact line(s) of the link within the selected node of the shape tree where the URI annotation should be applied. Use the names assigned to shapes and shape trees (not the tags in brackets). 

The purpose of a URI annotation is to define the location and shape of the clickable area on a PDF page, as well as the action triggered when a user clicks within this area.

Since links can span multiple text lines, the annotation must cover each individual line of the link. With this expression, you select the containers in the shape trees that each contain an individual line of the link. This directly influences the shape and coverage of the clickable area.

axesFlip uses QuadPoints to generate a rectangle for each line of the link within a single URI annotation.


Contents Expression

Define the content of the hyperlink. You can enter a static string or use an expression to generate it dynamically.

Available variables:

  • item: the current shape tree item being processed from the input list. item has the same properties as a shape tree object.
  • uri: the URI string resulting from evaluating the URI expression
  • index: the zero-based index of the item in the input list
  • first: the first item in the input list
  • last: the last item in the input list
  • prev: the previous item in the input list. prev has the same properties as a shape tree object.
  • next: the next item in the input list. next has the same properties as a shape tree object.
  • count: the total number of items in the input list

Expected return type: string

Example 1:

item.text

Uses the text of the input item as content.

Example 2:

index = count -2 ? "Contact us" : 
last ? "Website":
item.text

If the current item is the second-to-last in the sequence, use the string "Contact us".
If the current item is the last in the sequence, use the string "Website".
Otherwise, use the item’s text as content.

Example 3:

uri = "mailto:mail@example.com" ? "Contact us" : 
uri = "https://www.example.com" ? "Website":
item.text

If the generated URI of the current item is "mailto:mail@example.com", use the string "Contact us" as content.
If the generated URI of the current item is "https://www.example.com", use the string "Website".
Otherwise, use the item’s text as content.