0

I'm using enscript to produce a pdf file. I wish to include a header that contains the filename, like that

enscript --header='$n' ... file.py | ps2pdf - file.pdf

Every page of the resulted pdf includes a header with the filename. How can I have this header only on the first page of the pdf?

1 Answer 1

0

It seems that such option does not exist in enscript. I managed to achieve that by producing separate pdfs, one with the first page and a header and another with the rest of the pages and no header, and then combine them

enscript --output="-" --header='$n' --pages="1" "$infile" | ps2pdf - "$outfile.tmp1" # first page with header
enscript --output="-" --header='' --pages="2-" "$infile" | ps2pdf - "$outfile.tmp2"  # rest of the pages without header
pdftk "$outfile.tmp1" "$outfile.tmp2" cat output "$outfile"                          # concat results
rm "$outfile.tmp1" "$outfile.tmp2"

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.