I convert .txt files to .ps files with enscript, OK! After that I use "ps2pdf" to convert the .ps files to .pdf files. OK!

And I can see:

enter image description here

Question: What parameter do I have to use (with enscript or ps2pdf) to give the PDF's custom "$subject" name (I don't want "Enscript Output" title on the top of my PDF reader).

So this is not about the filenames, this is about the "$subject" that a PDF file has.

  • In English, it's called a title, not a subject. This should help when looking for documentation. – Gilles 'SO- stop being evil' Apr 12 '12 at 23:50

Angus is correct about the %%Title: comment controlling the title that the PDF will have. But the easiest way to set the title with enscript is to use its --title option:

enscript --title 'My PDF title' foo.txt -o foo.ps
| improve this answer | |
  • That is certainly easier :). – angus Apr 13 '12 at 7:45
  • @cjm, What could I do if I have only the PDF file? I'd like to change its title which is different from its file name. – Sigur Apr 29 '13 at 20:06

At the beginning of each PS file, there are especially formatted comments with some important metadata. Among them, the title (take a look to the output of head your-ps-file.ps).

You need to change the %%Title: comment. One way could be to do it right when you convert it to PDF.

< psfile.ps sed '1,/^%%EndComments/ s/^%%Title:.*/%%Title: New Title/' | \
ps2pdf - pdffile.pdf
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.