PDF with pages of different orientation, I want all in portrait

  • Follow


Hi !

I've some pdf that results of the concatenation of two pdf.
And some of them have one page in portrait, and other pages in
landscape.

I'm looking for a linux command applied on a PDF, PS or TIFF, that can
rotate all landscape in portrait, and keep the portrait page
unchanged.

At the result I want all pages in portrait.

I know the command that can rotate an entire pdf : 
gs -sDEVICE=pdfwrite -sOutputFile="file.pdf" -dNOPAUSE -dEPSCrop -c
"<</Orientation 1>> setpagedevice" -f "file.ps" -c quit
this command rotate the ps and convert it to pdf.

I tried the autorotate but it doesn't work

The command I'm looking for must rotate only paysage page.

Does it exists ?

Thanks in advance!
0
Reply sylvain 6/16/2004 9:03:56 AM

iubito wrote:
> 
> Hi !
> 
> I've some pdf that results of the concatenation of two pdf.
> And some of them have one page in portrait, and other pages in
> landscape.
> 
> I'm looking for a linux command applied on a PDF, PS or TIFF, that can
> rotate all landscape in portrait, and keep the portrait page
> unchanged.
> 
> At the result I want all pages in portrait.
> 
> I know the command that can rotate an entire pdf :
> gs -sDEVICE=pdfwrite -sOutputFile="file.pdf" -dNOPAUSE -dEPSCrop -c
> "<</Orientation 1>> setpagedevice" -f "file.ps" -c quit
> this command rotate the ps and convert it to pdf.
> 
> I tried the autorotate but it doesn't work
> 
> The command I'm looking for must rotate only paysage page.
> 
> Does it exists ?
Acrobat (the full version), but it's on Windows of Mac.
> 
Helge


-- 
H.Blischke@srz-berlin.de
H.Blischke@srz-berlin.com
H.Blischke@acm.org
-1
Reply Helge 6/16/2004 11:20:26 AM


sylvain.machefert@segeco.fr (iubito) writes:

>I'm looking for a linux command applied on a PDF, PS or TIFF, that can
>rotate all landscape in portrait, and keep the portrait page
>unchanged.

I don't know of a single command to handle that.

I'd use iText for PDF.  Python Imaging Library (PIL) for TIFF.  I don't
know what to use for PS but it's certainly possible.

--kyler
0
Reply Kyler 6/16/2004 3:09:54 PM

A simple Acrobat-JavaScript should do it by detecting if width is
larger than height.
I don't know anything about Linux commands nor iText nor Python, but
why not ?
0
Reply jrboulay 6/17/2004 12:48:46 AM

Mmmmmmm...
Please, remove the word "simple" from my previous post.
;-)
0
Reply jrboulay 6/17/2004 12:51:29 AM

You can do it with  GS and a small postscript program.

You have to redefine showpage operator with your code where:
a - detect orientation 
b - rotate 
c - call original showpage.

Suppose your patch is in a file named rot.ps then invoke gs:
gs -q -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf -dDELAYBIND
-dWRITESYSTEMDICT ...... rot.ps yourpdf.pdf

I done a program in order to put a watermark and it works fine.

Santino
0
Reply mc5422 6/17/2004 8:32:29 AM

5 Replies
1086 Views

(page loaded in 0.096 seconds)

Similiar Articles:













7/22/2012 12:34:14 PM


Reply: