How to create programmatically named destinations in a PDF from comments starting with a custom ID

66 Views Asked by At

In many PDF editors, it's not possible to create permanent bookmarks, also called named destinations, but it usually is to create comments. It's also faster to just make those. I need a way to can link to them reliabily and as far as I know, you can't open a PDF at a specific comment, but even browsers can open at named destinations.

So I would like to make comments, which starts with an ID (ex. #24abc: This is it) and then add them to the outline, reusing this ID (ideally under a title "Comments", for instance). I would need a program capable of searching for the ID pattern, extract the IDs (ex. 24abc) and create named destinations from them. It's important that those can be seen by most PDF editors (I use the command pdfinfo -dests FILENAME from Poppler for this). I would prefer to use a free software, but I'm open to any, also paid ones.

I checked some tools like Pymupdf and PDFtk, but I can't find out if it's possible to create true bookmarks (named destinations) and how to do it properly.

0

There are 0 best solutions below