5

How can I rotate an image with ghostscript? I am visualizing eps to screen. I am using the command:

gs image.eps
sr_
  • 15,224
  • 49
  • 55
simona
  • 1,001
  • 3
  • 13
  • 27

2 Answers2

2

try this way:

gs -dEPSCrop -c "<</Orientation 1>> setpagedevice" -f input.eps -c quit

P.S this code snippet come from this post in the rhinocerus forum.

andcoz
  • 16,830
  • 3
  • 38
  • 45
  • 1
    I have never understood what is '-c quit' for – simona Jan 09 '13 at 15:00
  • 2
    @simona, "-c" executes a postscript command. The last "-c" option in the example executes "quit" command and ends the postscript elaboration. If you omit it, you'll obtain a ghostscript prompt waiting for a command. – andcoz Jan 11 '13 at 21:49
1

A bit more modern Ghostscript

Newer Ghostscript versions come with the much improved eps2write device.

gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=eps2write \
  -sOutputFile=output.eps \
  -c "<</Orientation 3>> setpagedevice" \
  -f input.eps

The -dSAFER option keeps thing safe, prohibiting the input Ghostscript from performing arbitrary file read/write operations.

bufh
  • 379
  • 3
  • 6
Serge Stroobandt
  • 2,314
  • 3
  • 32
  • 36