views:

251

answers:

2

Hi everyone!
is there a way to rotate a PDF 90 degrees losslessly, with Python or using the command line?

I'm looking for a REAL rotation, not just adding a "/ROTATE 90" inside the PDF, because afterwards I have to send the PDF via Hylafax and it looks like that it ignores those commands.

I tried with ImageMagick's convert but the quality of the resulting PDF is quite low.

(Python 2.6.2, Xubuntu 9.04)

Thanks for your attention!

+3  A: 

The best resolution you will normally obtain from a standard fax machine is about 200dpi; standard faxes are about 100dpi. If you need your faxed documents to work with an artitrary fax machine you can't go above this.

Ergo, rendering your PDF to a 100 or 200dpi bitmap and rotating it 90 degress should work as well as anything. Various ghostscript based tool chains can do the rendering. Alternatively, there are a number of PDF and postscript based tools that can do this type of manipulatiion (e.g. PDF2PS and psutils) directly off the PDF.

ConcernedOfTunbridgeWells
+3  A: 

In the pdfjam package there is a shell script pdf90 which does the rotation via pdflatex.

rcs
Woa, 256Mb of dependencies.. X-) I'll try it anyway, thanks :)
Joril
Oh yeah :) a LaTeX distribution typically needs several hundred MB of hard disk space
rcs
The rotation looks nearly lossless though.. Nice!
Joril