AAA
AAA

Reputation: 2450

How to add footer to pdf with pdfjam or pdftk?

I am using a shell script to modify many pdfs and would like to create a script that adds the page number (1 of X format) to the bottom of PDFs in a directory along with the text of the filename.

I tried using pdfjam with this format:

pdfjam --pagenumbering true

but it fails saying undefine pagenumbering

Any other recommendations how to do this? I am OK installing other tools but would like this to all be within a shell script.

Thank you

Upvotes: 1

Views: 1544

Answers (1)

notautogenerated
notautogenerated

Reputation: 341

tl;dr: pdfjam --pagecommand '' input.pdf

By default, pdfjam adds the following LaTeX command to every page: \thispagestyle{empty}. By changing the command to an empty command, the default plain page style is used, which consists of a page number at the bottom. Of course you may want to play with other styles or layout options to position the page number differently.

Upvotes: 3

Related Questions