Sounds to me like you need to set the Title in the Document /Info dictionary of the PDF file. You can do that by sending a DOCINFO pdfmark.
You can pick up the pdfmark reference manual by googling for it. Its on the Adobe web site but they move the furniture so often there's no point in quoting today's URL.
You can find the DOCINFO pdfmark described on page 28 of the Acrobat 9 refrence (I've no idea if there's a newer one), you'll need something like:
[ /Title (My Title goes here) /DOCINFO pdfmark
That is PostScript so you need to supply it to Ghostscript as PostScript, which means you need the -c
and -f
switches. So something like:
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outputName -c "[ /Title (My Title goes here) /DOCINFO pdfmark" -f
You're lucky I spotted this, since you didn't tag it with Ghostscript.
header
is only telling the browser what filename it 'should' use (and depending on the browser, it may ignore your definition), not what the actual physical file is named on the server. You would need to use the rename action to change the filename on the server after you are done. – IncredibleHat