HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-users] pdf2fax - set orientation portrait for all pages



Hi !
 
I'm using hylafax 4.1.8 and I'm looking for a way to rotate all paysage pages to portrait, in a PDF I want to send by fax.
If some of my pages remain paysage, they'll not be printed correctly on the fax :(
 
I know how to rotate a whole document for 1/4, 1/2 or 3/4, but I don't know how to do this individually for each page who need this.
 
Your help will be greatly appreciated !
 
 
For info, here's my command to rotate an entire PDF document, without caring about each page orientation.
/usr/local/bin/rotatepdf.sh source.pdf result.pdf 3 #rotate 1/4 clockwise source.pdf and write in result.pdf
 
--rotatepdf.sh--
#!/bin/bash
#Rotate a PDF file
cd /usr/bin
#make a .ps
/usr/bin/pdf2ps "$1" "$1.rotate.ps"
#make a pdf and orientation is given by $3
/usr/bin/gs -sDEVICE=pdfwrite -sOutputFile="$2" -dNOPAUSE -dEPSCrop -c "<</Orientation $3>> setpagedevice" -f "$1.rotate.ps" -c quit
#delete our temp .ps
rm "$1.rotate.ps" -f 2>/dev/null
 
Sylvain MACHEFERT
 



Project hosted by iFAX Solutions