How to set hidden element/text/id in background for visible text in pdf document

Viewed 54

I am giving internal link in pdf document using pdfbox library. For that I am comparing the string and get the co-ordinates of string from pdf document and add link on string. This is working fine and here is the link.
Now, I have two same string and I want to redirect to two different pages like following

Link 1 -> redirects to Page 3
Link 1 -> redirects to Page 5

Is there any way that while creating pdf I add some hidden element/text/id in Link 1 in background from which I can identify on which page I should redirect.

0 Answers
Related