How to add footer to pdf with pdfjam or pdftk?

萝らか妹 提交于 2021-01-28 19:56:21

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!