I am working on a web app (PHP) that is used to create books in both PDF and print form. Each book page is saved as an individual high resolution JPEG and inserted into a new PDF document created by TCPDF (http://www.tcpdf.org/). The last page has an additional watermark image (PNG, 2500×2000, 72dpi) inserted near the bottom.
All of that works fine, but I am running into trouble when I invoke Ghostscript to optimize the PDF using the following command. It handles entire PDF without error except that the watermark is missing.
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=LowResOutput.pdf -dPDFSETTINGS=/screen -dCompatibilityLevel=1.4 HiResInput.pdf
I have confirmed that the watermark is displaying correctly in the unoptimized source file. If I change the quality settings (-dPDFSETTINGS) from /screen to /printer it produces a high resolution PDF that includes the watermark.
I’m not sure if I am missing a quality/output setting that is causing the watermark image to be excluded or what. If anyone has an idea of why this is happening I would greatly appreciate a response.
Thanks!
What version of Ghostscript are you using ? How is the ‘watermark’ created ? (annotation, modification to the page content stream, something else ? Is it transparent ?)
Don’t use the PDFSETTINGS without completely understanding the impact of all the individual settings, most likely is a colour conversion causing some change in the output but there could be other reasons. Broadly speaking I wouldn’t use the PDFSETTINGS switch at all, set up each switch individually.
Finally, can you put a (small!) file of the type you are sending to Ghostscript somewhere public. Its almost impossible to make informed comment without seeing an example.