5

I am having a bizarre problem in converting postscript to pdf using ps2pdf. Here is a minimal code snippet that causes the problem.

/Times findfont 40 scalefont setfont
-1 1 scale
15 15 moveto (R) show

This should show the letter, horizontally reflected. And when I view the postscript, that's what I see. But if I take the code above, save it as a file "bad.ps" and run the following command on it

ps2pdf bad.ps

I get a vertically reflected letter R.

I get the same problem with other fonts. BUT when I just draw lines, etc., the problem goes away. Any ideas?

1
  • note you are also drawing off page (in negatve page space). Properly to draw a backwards R at page 15 15 you need : -1 1 scale -30 15 moveto (R) show - and with that I reproduce your unexpected 180 rotation.
    – agentp
    Feb 27, 2013 at 16:11

1 Answer 1

9

It sounds like the orientation of the PDF is rotated. By default, PS2PDF detects the orientation based on the dominant text orientation on the page. To override this behavior, use the

-dAutoRotatePages=/None

command line option. This option is described in more detail on the PS2PDF command line reference.

3
  • confirm this works (With the -30 mod in my other comment). I'd still flag this a bug, by what logic does the code decide upsidedown is better than backwards?
    – agentp
    Feb 27, 2013 at 16:15
  • Its a heuristic, it tries to get text to go left->right, sometimes it gets it wrong, heuristics do that.
    – KenS
    Mar 1, 2013 at 17:40
  • Still I think if you don't want to have pages rotated, use the settings (and accept it as a valid answer).
    – U. Windl
    Sep 2, 2019 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.