0

I want to convert some single page postscript files to eps. They are from the same source multiple page ps file, extracted with psselect. Some of the pages (the short ones) are rotated (by 90° to the left) with respect to their original orientation when I do ps2eps $file. In the the ps2eps man pages (ftp://ftp.tex.ac.uk/tex-archive/support/ps2eps/doc/html/ps2eps.html) I found: ps2eps filters also %%Orientation. But I checked with diff file.ps file.eps that the only difference between the files is

diff tmp.ps tmp.eps 
1c1,3
< %!PS-Adobe-3.0
---
> %!PS-Adobe-2.0 EPSF-2.0
> %%BoundingBox: 132 613 466 750
> %%HiResBoundingBox: 132.000000 613.500000 465.500000 749.500000
9d10
< %%Pages: 1 0
12a14,23
> % EPSF created by ps2eps 1.68
> %%BeginProlog
> save
> countdictstack
> mark
> newpath
> /showpage {} def
> /setpagedevice {pop} def
> %%EndProlog
> %%Page 1 1
14d24
< 
85d94
< 
476a486,490
> %%Trailer
> cleartomark
> countdictstack
> exch sub { end } repeat
> restore

So why does it change orientation and how can I prevent it? Note that I instructed my viewer to display it in original orientation.

highsciguy
  • 2,569
  • 3
  • 34
  • 59
  • What does `grep Orientation tmp.ps` say? – devnull Apr 04 '13 at 12:13
  • It does not print any output. – highsciguy Apr 04 '13 at 12:16
  • I would try with `-dAutoRotatePages=/None` switch, which I use by default with `gs` as I found that it always does rotate pages automatically for some reason. – theta Apr 04 '13 at 13:39
  • How would you use it? With `psselect`, `djvups` or do I need an additional conversion `gs -dAutoRotatePages=/None tmp.ps tmp_new.ps`? – highsciguy Apr 04 '13 at 13:46
  • 1
    I don;t think ps2eps uses the ps2write device (I'm not certain it even uses Ghostscript) and so that switch will have no effect. How are you checking the orientation of the EPS files ? – KenS Apr 04 '13 at 16:33
  • There is a -d switch for ps2pdf which outputs a gs command 'for debugging purposes'. I tried to use this one, but without modification it seems to print the bounding box only. – highsciguy Apr 04 '13 at 17:56
  • Ah sorry, I thought you were using `ps2eps` GhostScript script, which seems to be called `ps2epsi` here. Maybe you could try that instead? – theta Apr 04 '13 at 22:08
  • Amongst others I am using `ps2eps` (my production chain is `djvups`->`psselect`->`ps2eps`->... After `ps2eps` I first encounter wrong orientation. But I don't know how to provide `-dAutoRotatePages=/None` as argument to `ps2eps` as the switch `-d` merly prints a `gs` command on the console. If you can tell me how to produce consistend eps with `gs`, please let me know! – highsciguy Apr 05 '13 at 06:12
  • Well it does sound like you are using Ghostscript, but as I said before, the epswrite device doesn't honour the /AutoRotatePages switch, so there's no point trying to set it. The epswrite device also doesn't rotate pages at all, so its hard to see how this could be a problem. Sadly if you can't supply an example to look at, its not really possible to help. – KenS Apr 05 '13 at 08:11

3 Answers3

2

On my MacBook Pro in Terminal adding the flag "-R=-" preserves orientation:

ps2eps -R=- input.ps

  • Welcome to StackOverflow! While this might be a good solution for preventing the orientation change, this would be a great answer if it also explained to the asker why the change occurs. Please consider adding additional information to really make this answer great. – Michael Celey Jun 11 '13 at 00:43
1

If your generated eps file is rotated 90 degrees anti-clockwise for example, you can avoid this issue by amending the conversion command to 'ps2eps +R=+ file.ps' which rotates the generated eps file 90 clockwise.

Also looking at the options with '-R' under 'ps2eps --help' shows many options to rotate your generated eps file.

1

i found a work-around which works for me but some of you might not like. Here goes... First use ps2pdf then delete the original ps then use pdf2ps then use ps2eps

I know it sounds ridiculous but thats the only thing that works for me without any drawbacks and the quality seems to be still there in my case. Good luck

Ross
  • 11
  • 1