How do I add a clickable area with an external link? #1373
-
Hi, I'm looking to add clickable links to existing PDFs. Here's what I have so far:
I understand handling links is a new feature and if it's not possible to do what I want, please let me know :) Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
On the contrary: it is quite an old feature 😉and you sure can do it. Some background: There is |
Beta Was this translation helpful? Give feedback.
On the contrary: it is quite an old feature 😉and you sure can do it.
Some background:
Links and annotations used to be supported for all document types in MuPDF. Annotation support has then been restricted to PDFs at some point.
In PyMuPDF, annotations have been added much later than links. This is why they are handled via a differently looking API.
There is
page.insert_link(link)
to insert a new link on a page. The argument must a dictionary as described here, look at section heading "Description of get_links() Entries".