Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
In English, it's called a title, not a subject. This should help when looking for documentation. –  Gilles Apr 12 '12 at 23:50
add comment

2 Answers

up vote 3 down vote accepted

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
share|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
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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