Does anybody know how to add page number at footer for PDF? Followed is an example to show how to add page number at header by using enscript, ps2pdf pdftk. It works.
#!/bin/bash
input="$1"
output="${1%.pdf}-header.pdf"
pagenum=$(pdftk "$input" dump_data | grep "NumberOfPages" | cut -d":" -f2)
enscript -L1 --header='|Page $% of $=|' --output - < <(for i in $(seq "$pagenum"); do echo; done) | ps2pdf - | pdftk "$input" multistamp - output $output
According to enscript's manual, changing --header to --footer will work for footer. But in fact, no matter how I set the option for --footer, there is no footer at all. What's the matter? Does --footer work for enscript?