pátek 8. března 2024

add text to the first page of a PDF file

 1. crop pdf files 

pdfcrop --margins '-30 -30 -10 -20' input.pdf output.odf

margins: left, top, right, bottom


2.

string="this is a string"
tmpfile=$(mktemp) && echo $string | \
enscript -M a4 --margins=::0: -B -f Courier-Bold8 -o- | \
ps2pdf - "$tmpfile" && \
qpdf input.pdf --overlay "$tmpfile" -- output.pdf && \
rm -f  "$tmpfile" 

enscript --margins=left:right:top:bottom