Recentemente, me envolvi em um assunto jurídico, para o qual escrevi um script em PDF "Bates-stamping", pdfBatesStamp.sh
.
trecho de uso
# "Bates-stamp" a PDF file with text (only; images aren't supported). Uses
# ghostscript (ps2pdf) and pdftk.
#
# The output (Bates-stamped) file is put in the same directory, with "_BATES"
# appended to its name, thusly:
# pdfBatesStamp.sh <FILE>.pdf ==> <FILE>_BATES.pdf
#
# Usage:
# pdfBatesStamp.sh <FILE>.pdf [PREFIX(def=<FILE>)] [STARTNUM(def=1)]
# pdfBatesStamp.sh <FILE>.pdf BATESCONFIG=<bates_config_filename>
#
# The <FILE>.pdf name must end in ".pdf". You can make many more settings
# inline below (you can also set PREFIX and STARTNUM there too if you want).
# The first invocation format above is for the most common case (e.g., for legal
# use). In the second invocation format, the <bates_config_filename> file can
# contain any of the inline user-settings (below, from PREFIX to EXTRAS,
# inclusive), and they will overwrite the inline settings. In this way, you can
# write/store special config file settings for special PDFs, without needing to
# modify the inline settings each time. Runs at ~3 pages/sec.
Script completo disponível para download em pastebin, pdfBatesStamp.sh .