I've merged two PDF using the command
$cmd = "gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outputName ";This is working for me. But the issue is title of the new generated PDF is not set as per I've set in the
header('Content-Disposition: inline; filename="Test.pdf"');
I'm expecting the title to be Test.pdf but the title remains the title of the last PDF in the merged PDFs.
In Frame 2019, you can set the PDF tab title using "File Info" in the book file. Open the book file and choose File > File Info. The File Info window opens. In the Title field, type the tab title. Choose Set to commit the change. Save the file. Now, when you generate the PDF, the new title should appear in the PDF tab title.
If a PDF does not have a title, the filename appears in the results list instead. A file’s title is not necessarily the same as its filename. The Advanced area shows the PDF version, the page size, number of pages, whether the document is tagged, and if it’s enabled for Fast Web View.
Create document properties You can add custom document properties that store specific types of metadata, such as the version number or company name, in a PDF. Properties you create appear in the Document Properties dialog box. Properties you create must have unique names that do not appear in the other tabs in the Document Properties dialog box.
Add a description to Document Properties You can add keywords to the document properties of a PDF that other people might use in a search utility to locate the PDF. Choose File > Properties. Click the Description tab, and type the author’s name, subject, and keywords.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With