How can I programmatically renumber pages in a PDF?

Posted by Andrew on Super User See other posts from Super User or by Andrew
Published on 2013-05-08T01:38:25Z Indexed on 2013/11/11 16:00 UTC
Read the original article Hit count: 339

Filed under:
|
|

As a graduate student, I come across PDFs of articles and book chapters on a daily basis. Sometimes these PDFs are paginated correctly internally (that is, if an article starts on page 67, the PDF starts on page 67 as well; not on page 1). When they aren't, I have to open the file in Acrobat and renumber the pages in the "Page Thumbnails" panel.

I would love to be able to automate this whole process with a script (bash, Python, AppleScript, whatever) that lets me pass the first actual page number... something like fixpagination example.pdf 67. However, I cannot find any terminal-based program that can re-paginate PDFs. Neither pdftk nor PyPDF seem to be able to deal with pagination.

Are there any scriptable programs that can internally re-paginate PDF files?

© Super User or respective owner

Related posts about osx

Related posts about pdf