Thursday, September 18, 2008

*nix command: ps2pdf -sPAPERSIZE=a4

I was trying to read this paper.  I downloaded the pdf, but the
top inch is cut off.  The postscript looks fine in a postscript
viewer like gv, but I prefer pdf viewers.  Running ps2pdf on
the postscript gave the same result as the pdf download on
the webpage.  Turns out the format is a4, so you need to run

ps2pdf -sPAPERSIZE=a4  paper.ps

This solved the problem.

5 comments:

  1. Anonymous6:57 AM

    Thanks for the hint. I had the same problem some days ago.

    Had to learn the hard way that on windows you have to use

    ps2pdf -sPAPERSIZE#a4 paper.ps

    ReplyDelete
  2. Hi Guys,
    Thanks for the post. I have cygwin on windoooze vista and the command ps2pdf -sPAPERSIZE#a4 file.ps gave no output (pdf file) and ended with "/usr/bin/ps2pdfwr: line 45:exec: gs.exe: not found". I do have gs installed. So I aliased gs.exe to gs and restarted the terminal. The problem persists. Comments?
    Thanks.

    ReplyDelete
  3. Anonymous6:13 AM

    useful post and comments, thanks a lot.

    ReplyDelete
  4. @Author: Thanks a ton :)

    ReplyDelete
  5. ps2pdf -sPAPERSIZE=a4 paper.ps
    results in an error message
    "Unknown paper size: ()."

    ReplyDelete