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

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.

  • comments are named destinations same as bookmarks and many hyperlinks they are just different names for goto. and *NO NOT all browser can use all of those (Chrome can use most by accumulation) The most common goto is “page name” since the numbers you see are not the internal names but are the ones #page=## uses More notes at stackoverflow.com/a/73915197/10802527 what is wrong with using free pdfinfo if it does what you need it is faster as executable than any other language such as java or python and NO what are called bookmarks are OUTLINE thus NOT nameddest, so not using same name

    – 




Leave a Comment