Add links internal pages of PDF file with python

360 views Asked by At

I have a python routine that builds a PDF file of around 100 pages. I would like to add something like an index page, with links to pages inside the same file.

I would like to know if that is even possible.

1

There are 1 answers

0
Vedang Wartikar On

You can add a preprocessing step before your PDF generation code by creating an intermediate (text-based) file. You can extract relevant links/titles (using regex or something similar) and add those in the index on an ad-hoc basis. Might be an extra step but you would get more flexibility incase you need to modify this functionality in future.