In this answer to ‘GhostScript command line parameters to convert EPS to PDF’; it is stated that the default resolution for the pdfwrite device of Ghostscript is 720×720, which I initially found unbelievable!
Is there a way to list the default options of a Ghostscript device?
Since Ghostscript is a full-blown PostScript interpreter, you can also send PostScript snippets to it which do not cause the drawing of page elements, but which query it for its internal state.
If you want to know what the default settings of the Display are, when you ask it via
gs some.pdfto just display a PDF on screen, you could try this:On Windows this becomes:
The result is a list of
/SomeName somevaluepairs which describe the settings used for rendering pages to the current screen.This is so because usually the display is the default device for Ghostscript to send its output to. Now you may notice that you’ll see an empty Ghostscript window pop up, which you’ll have to close…. Ah, how about adding some options to avoid the popup window?
Or, on Windows:
But this will change the query return values, because you (unintentionally) changed the output device settings:
Result:
Compare this to
Result:
So, please avoid this trap. I successfully fell into it a few years ago, and didn’t even notice it for quite a long time…
Now assuming you want to query for the default settings of the PDF writing device, run this one:
You’ll now have all settings for the
pdfwritedevice in a *.txt file. and you may repeat that with some other interesting Ghostscript devices and then compare them for all their detailled differences:It’s rather interesting to compare the settings for, say, the
pswriteandps2writedevices like this (and also discover parameters which are available for the one, but not the other device):Update:
As you may imagine this is also a great way to compare different Ghostscript versions, and track how default settings may have changed for different devices in recent releases. This is especially interesting if you want to find out about all the newly implemented color profile and ICC support which is now present in Ghostscript.
Also, to avoid the return of just
-dict-for certain key values, use the===instead of==macro.===acts like==but also prints the content of dictionaries.So here is the example output for the
pdfwritedevice. Remember, Ghostscript’spdfwritedevice is meant to provide mostly the same functionality as Adobe Acrobat Distiller (with the additional feature that it does not only accept PostScript as input, but also PDFs, so you can sort of redistill existing PDF files in order to repair, improve or otherwise manipulate them). Therefore, Ghostscript’spdfdevicehonors most of thesetdistillerparamsoperator which the original Distiller also supports:[*] Note:
/AntiAliasColorImages/AntiAliasGrayImages/AntiAliasMonoImages/AutoPositionEPSFiles/Binding/CalCMYKProfile/CalGrayProfile/CalRGBKProfile/CannotEmbedFontPolicy/ConvertImagesToIndexed/CreateJobTicket/DetectBlends/DoThumbnails/EmitDSCWarnings/EndPage/ImageMemory/LockDistillerParams/Optimize/PreserveCopyPage/PreserveEPSInfo/PreserveHalftoneInfo/PreserveOPIComments/sRGBProfile/StartPage/UsePrologue