问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/62969624/how-to-add-footer-to-pdf-with-pdfjam-or-pdftk