Remove Page Range Metadata from PDF

1

I've merged multiple PDFs that were generated with Latex. These PDFs contain page ranges, meaning "real page" 40 and "real page 41" are simple transitions - e.g. adding an item to a bullet list. So when going to page 41 in my PDF viewer I end up at "real page" 42.

Since multiple files have been merged these page ranges conflict themselves in my PDF viewer, see here (page 1 points to "real page" 260, 309, 338 etc.):

enter image description here

enter image description here

enter image description here

I've tried following this guide and this github gist to get rid off PDF metadata.

qpdf --linearize pages.pdf
# or
exiftool -all:all= pages.pdf

Both didn't work. Is there any way besides printing to PDF to get rid off this page metadata?

Elektropepi

Posted 2020-01-17T08:46:25.217

Reputation: 115

Answers

1

Take a look at pagelabels-py. It appears to be a python script that can edit PDF Page Labels. It gives this example command:
python3 -m pagelabels --delete file.pdf

StarGeek

Posted 2020-01-17T08:46:25.217

Reputation: 782

I have not actually tried this out, your question just got me interested in the idea. And now, I may look into actually doing this to a bunch of my pdfs. – StarGeek – 2020-01-17T20:28:07.900

Worked like a charm, thank you very much. – Elektropepi – 2020-01-18T14:43:53.320