Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ghostscript command line parameters to convert EPS to PDF

Tags:

Just installed Ghostscript 8.54 for Windows.

Does anyone know of the minimum parameters to pass to gswin32c.exe to make it convert, say, someFile.eps to someFile.eps.pdf?

like image 395
Chry Cheng Avatar asked Apr 24 '09 11:04

Chry Cheng


People also ask

How do I open an EPS file in Ghostscript?

From the Ghostscript downloads page, you want to choose “Postscript and PDF interpreter/renderer”, and then install the package appropriate to your version of Windows (32 bit or 64 bit). Once you have the Irfanview main application, its plugins, and Ghostscript installed, you're ready to view EPS files.

How do I run a ghost script?

The command line to invoke Ghostscript is essentially the same on all systems, although the name of the executable program itself may differ among systems. For instance, to invoke Ghostscript on Unix: gs [switches] {filename 1} ... [switches] {filename N} ...

How do I find Ghostcript version in Windows?

ps2pdf -v - should show you the version of Ghostscript ( gswin32c.exe ). It should be the same as rungs -v (GS used internally by TL).


1 Answers

Since the question was about the "minimum parameters to pass to gswin32c.exe to make it convert, say, someFile.eps to someFile.eps.pdf", let me give an answer:

  c:/path/to/gswin32c.exe ^     -sDEVICE=pdfwrite ^     -o c:/path/to/output.pdf ^     c:/path/to/input.eps 

or even shorter:

  gswin32c ^     -sDEVICE=pdfwrite ^     -o output.pdf ^     input.eps 

This will use the builtin, default parameters for Ghostscript. The most important of which, from the top of my head, for the most recent version of Ghostscript are:

  • -dPDFSETTINGS=/default ........ roughly the same settings as Adobe Distiller uses for "screen" with the following differences:
  • -r720x720 .................................. resolution: 720 dpi (bitmaps/fonts requiring conversion to bitmap)
  • -dColorConversionStrategy=/LeaveColorUnchanged ... (Distiller's "screen" uses =/sRGB)
  • -dCompatibilityLevel=1.4 .... (Distiller's "screen" uses =1.3)
  • -dEmbedAllFonts=true [*]......... (Distiller's "screen" uses =false)
  • -dOptimize=false [**] ............... (Distiller's "screen" uses =true)
  • -dDownsample{Color,Gray,Mono}Images=false ... (Distiller's "screen" uses =true)

[*] By default, Ghostscript does not embed the classical "Base 14"-PostScript fonts. To enforce that, use an extra parameter (at the end of the command line!) like -c "<</NeverEmbed [ ]>>setdistillerparams" -f c:/path/to/input.pdf.
[**] Ghostscript's pdfwrite device cannot "optimize" a PDF when it is writing it the first time. To optimize, you have to call Ghostscript again for a second pass, using special parameters (you may also try -dOptimize=true).

BTW, Ghostscript's most recent version is 8.71, available here: ghostscript.com/relases.

like image 118
Kurt Pfeifle Avatar answered Oct 22 '22 09:10

Kurt Pfeifle