[Bug-gs] Can't convert ps to jpg or gif
Jack Moffitt
jack@artifex.com
Tue, 27 Nov 2001 12:28:58 -0700
> I tried it a couple weeks ago and it worked, and now I get no output. I
> don't know what I'm forgetting.
>
> This works
>
> gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf -c save
> pop -f aperture_cav.ps
>
> but this does not
>
> gs -q -dNOPAUSE -dBATCH -sDEVICE=jpeg -sOutputFile=out.jpg -c save pop -f
> aperture_cav.ps
>
> I tried it without the save and without the pop and still no output file at
> all - not even a zero-size
I assume this is an EPS file, not a PS file.
Please refer to sourceforge bug #444791:
http://sourceforge.net/tracker/index.php?func=detail&aid=444791&group_id=1897&atid=101897
The pdfwrite device marks the page even without a showpage, which is why
it works with that device.
Here's the relevant exerpt:
To correctly process EPS files, one should first redefine
showpage to be an empty procedure (in case the EPS file
contains a showpage which is permitted), then process
the EPS file, finally execute the original showpage (from
systemdict). This can be done with the following:
/showpage { } def
(epsfile.eps) run
systemdict /showpage get exec
quit
From the command line it is a little trickier but the
following can be used:
gs -sDEVICE=jpeg -sOutputFile=out.jpg -dNOPAUSE -dBATCH
-c "/showpage { } def " -f epsfile.ps -c
"systemdict /showpage get exec quit"
Regards,
jack.