[tex-live] epstopdf: passing command-line options through to ghostscript (patch)

Markus Kuhn Markus.Kuhn at cl.cam.ac.uk
Fri Mar 8 16:51:17 CET 2013

Feature suggestion: could you please add to the epstopdf script at

   #  2012/05/22 v2.18 (Karl Berry)

a command-line option that allows a user to pass arbitrary commandline
options on to ghostscript?

Reason: Ghostscript provides many parameters that a user might want to
tweak during the EPS->PDF conversion, such as resampling the resolution
or font embedding. Allowing the user access to the ghostscript command
line makes it easy to make such tweaks.

Example usage:

   epstopdf --gsopt='-dPDFSETTINGS=/ebook' file.eps

I've attached a suggested patch that adds a new option --gsopt to
that effect. You can specify --gsopt several time to add more than
one option.



Markus Kuhn, Computer Laboratory, University of Cambridge
http://www.cl.cam.ac.uk/~mgk25/ || CB3 0FD, Great Britain
-------------- next part --------------
Index: epstopdf
--- epstopdf	(revision 1644)
+++ epstopdf	(working copy)
@@ -184,6 +184,7 @@
 $::opt_filter = 0;
 $::opt_gs = 1;
 $::opt_gscmd = "";
+@::opt_gsopt = ();
 $::opt_help = 0;
 $::opt_hires = 0;
 $::opt_outfile = "";
@@ -213,6 +214,7 @@
   --(no)gs           run ghostscript       (default: $bool[$::opt_gs])
   --(no)hires        scan HiResBoundingBox (default: $bool[$::opt_hires])
   --gscmd=VAL        pipe output to VAL    (default: $GS)
+  --gsopt=VAL        pass command-line option VAL on to ghostscript
   --res=DPI          set image resolution  (default: $resmsg)
   --autorotate=VAL   set AutoRotatePages   (default: $rotmsg)
                       Recognized VAL choices: None, All, PageByPage
@@ -245,6 +247,7 @@
   "gscmd=s", 		# \ref{val_gscmd}
+  "gsopt=s@",
   "outfile=s", 		# \ref{openout_any}
@@ -365,6 +368,9 @@
   if ($::opt_autorotate and
     not $::opt_autorotate =~ /^(None|All|PageByPage)$/);
+### options passed through
+push @GS, @::opt_gsopt;
 ### option BoundingBox types
 my $BBName = "%%BoundingBox:";
 !($::opt_hires and $::opt_exact) or

More information about the tex-live mailing list