Hello,

Thank you for your replay, my page 2 still display as upside down. I have 
a question:
I use 
Document doc = new Document(PageSize.LEGAL.rotate());

int rotation1 = reader.getPageRotation(1);
int rotation2 = reader.getPageRotation(2);

the rotation returns for page 1 = 0, and page 2 = 180 (I don't know why 
like that)

Could you please explain the values are passed into 

 cb.addTemplate(page2, 0, -1f, 1f, 0, 0, 
reader.getPageSizeWithRotation(2).getHeight());

If I force using above code it display page in 90 degree, how do I turn it 
to right 180?

Thank you very much!

Ping






From:
1T3XT info <[EMAIL PROTECTED]>
To:
Post all your questions about iText here 
<itext-questions@lists.sourceforge.net>
Date:
05/23/2008 03:13 AM
Subject:
Re: [iText-questions] some pages are not displaying right



Ping Zhang wrote:
> 
> Hi Paulo,
> 
> Thank you very much for the help, but I don't know how  to do that 'take 

> the page rotation into account'.  Could you please explaining ?

Oops, I didn't see the question was already answered.

Have a look at the following snippet (x is the page number)

PdfImportedPage page = writer.getImportedPage(reader, x);
//determine if the page needs to be rotated
int rotation = reader.getPageRotation(x);
if (rotation == 90 || rotation == 270) {
   cb.addTemplate(page, 0,-1f, 1f, 0, 0, 
reader.getPageSizeWithRotation(x).getHeight());
} else {
   cb.addTemplate(page, 1f, 0, 0, 1f, 0, 0);
}
-- 
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to