22

I know there is a Ghostscript option, for instance -dPDFSETTINGS=/screen - where is that documented? How can I see what other options it accepts, appart from screen? Also, -dMaxSubsetPct=100 - what does it do?

I open man gs, search for PDFSET, I get "Pattern not found". I type in a search engine, I get a myriad of personal webpages, no documentation hits.

Can anyone help with a link?


EDIT: also see this related post:

Querying Ghostscript for the default options/settings of an output device (such as 'pdfwrite' or 'tiffg4') - Stack Overflow

... for getting a list of supported options for a given device.

4 Answers 4

19

From the Overview of Ghostscript page, I found the VectorDevices.htm page explains dPDFSETTINGS:

-dPDFSETTINGS=configuration
Presets the "distiller parameters" to one of four predefined settings:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
  • /default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.

On the same page, MaxSubsetPct only appears in a table of recognized "Acrobat Distiller 5 parameters defined in the DistillerParameters document included in the Acrobat SDK", and links to that SDK.

Instead of downloading the large SDK, I searched for "Distiller Parameters" on Adobe's site and found Adobe PDF Creation Settings which explains MaxSubsetPct on page 88:

MaxSubsetPct

Supported by: all applications
Type: integer
UI name: Subset embedded fonts when percent of characters used is less than: value %
Default value: 100

The maximum percentage of glyphs in a font that can be used before the entire font is embedded instead of a subset. The allowable range is 1 through 100.

Distiller only uses this value if SubsetFonts is true. For example, a value of 30 means that a font will be embedded in full (not subset) if more than 30% of glyphs are used; a value of 100 means all fonts will be subset no matter how many glyphs are used (because you cannot use more than 100% of glyphs).

2
  • Many thanks for that @Bavi_H - so I should have looked for ps2pdf instead! Well, that didn't really occur to me, so I appreciate the pointer :) Cheers!
    – sdaau
    Jun 12, 2012 at 2:23
  • links are deadd Jun 13, 2019 at 2:47
16

To get a list of all these options supported by -dPDFSETTINGS=..., you can do this:

gs \
  -dNODISPLAY \
  -c ".distillersettings {exch ==only ( ) print ==} forall quit"

You should see this Result:

/default -dict-
/prepress -dict-
/PSL2Printer -dict-
/ebook -dict-
/screen -dict-
/printer -dict-

You can execute the following Ghostscript command to query for the detailed settings of the -dPDFSETTINGS=/screen parameter:

gs \
  -q \
  -dNODISPLAY \
  -c ".distillersettings /screen get {exch ==only ( ) print ===} forall quit" \
| sort

This one queries Ghostscript's internal .distillersettings dictionary, which holds a key named /screen, whose value again is another dictionary... The output should be something like this (may vary slightly depending on your exact Ghostscript version):

/AutoRotatePages /PageByPage
/CannotEmbedFontPolicy /Warning
/ColorACSImageDict << /ColorTransform 1 /QFactor 0.76 /Blend 1 /HSamples [2 1 1 2] /VSamples [2 1 1 2] >>
/ColorConversionStrategy /sRGB
/ColorImageDownsampleType /Average
/ColorImageResolution 72
/CompatibilityLevel 1.3
/CreateJobTicket false
/DoThumbnails false
/EmbedAllFonts true
/GrayACSImageDict << /ColorTransform 1 /QFactor 0.76 /Blend 1 /HSamples [2 1 1 2] /VSamples [2 1 1 2] >>
/GrayImageDownsampleType /Average
/GrayImageResolution 72
/MonoImageDownsampleType /Average
/MonoImageResolution 300
/NeverEmbed [/Courier /Courier-Bold /Courier-Oblique /Courier-BoldOblique /Helvetica /Helvetica-Bold /Helvetica-Oblique /Helvetica-BoldOblique /Times-Roman /Times-Bold /Times-Italic /Times-BoldItalic /Symbol /ZapfDingbats]
/PreserveEPSInfo false
/PreserveOPIComments false
/PreserveOverprintSettings false
/UCRandBGInfo /Remove

The same you can do for all the (other) parameters -dPDFSETTINGS=... can take:

  • /prepress
  • /printer
  • /default
  • /screen
  • /ebook
  • /PSL2Printer

It's quite interesting to compare the detailed settings of all these (and also look up in parallel the Documentation for Ps2pdf.htm...).

5
  • Suppose I want to tweak one of the parameters within the screen settings. How would I pass all these commands on the command line to gs? Jun 13, 2019 at 2:42
  • @AlecJacobson: To answer your question you'd have to name which parameter you'd want to tweak. Jun 13, 2019 at 10:19
  • I'm basically look for the answer to this (unanswered) question on SO stackoverflow.com/questions/54289570/… Jun 13, 2019 at 13:38
  • @AlecJacobson: This doesn't help me quickly grasp what your problem is. (I'm available for hiring by the hour, should that help you, though...) Jun 13, 2019 at 14:15
  • Current doc
    – Ax_
    Apr 7, 2022 at 23:37
4

This is a good document for new users:

https://ghostscript.readthedocs.io/en/latest/Use.html

2
  • Many thanks for that, @nwhsvc - it looks like indeed a very good document (just gave it a quick browse), but again, it doesn't mention neither "-dPDFSETTINGS" nor "-dMaxSubsetPct", let alone explain what they do. Is there a reference that explains these? Cheers!
    – sdaau
    Jun 12, 2012 at 0:05
  • 1
    The link is dead.
    – Socowi
    Mar 31, 2020 at 16:04
3

I found the following:

ps2pdf:

"Screen Optimized" "eBook" "Print Optimized" "Prepress Optimized"

Acrobat 'Save as Adobe PDF' printer dialog:

"Press Quality" "High Quality Print" "Smallest File Size" "Standard"

Adobe PDF presets:

Press Quality

Creates PDF files for high-quality print production (for example, for digital printing or for color separations to an imagesetter or platesetter). However, it does not create files that are PDF/X compliant. In this case, the quality of the content is the highest consideration. The objective is to maintain all the information in a PDF file that a commercial printer or print service provider requires to print the document correctly. This set of options uses PDF 1.4, converts colors to CMYK, and downsamples color and grayscale images to 300 ppi and monochrome images to 1200 ppi. It embeds subsets of all fonts and preserves transparency (for file types capable of transparency).

High Quality Print

Creates PDFs for quality printing on desktop printers and proofing devices. This preset uses PDF 1.4, downsamples color and grayscale images to 300 ppi and monochrome images to 1200 ppi. It also embeds subsets of all fonts, leaves color unchanged, and does not flatten transparency (for file types capable of transparency).

Smallest File Size

Creates PDF files for displaying on the web or an intranet, or for distribution through an email system. This set of options uses compression, downsampling, and a relatively low image resolution. It converts all colors to sRGB, and (for Adobe Acrobat Distiller-based conversions) does not embed fonts. It also optimizes files for byte serving.

Standard

Creates PDF files to be printed to desktop printers or digital copiers, published on a CD, or sent to a client as a publishing proof. This set of options uses compression and downsampling to keep the file size down. However, it also embeds subsets of all (allowed) fonts used in the file, converts all colors to sRGB, and prints to a medium resolution. Windows font subsets are not embedded by default.

There's no exact correlation with the ps2pdf PDFSETTINGS but it at least gives an idea of the differences in preset qualities.

1
  • It should be noted that, according to the Ghostscript manual, the best quality is obtained by not specifying PDFSETTINGS; see here.
    – Marcus
    Mar 27, 2022 at 22:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .