Kevin,

Thank you for helping with the rotation matrices.  I tried them and they worked 
just fine.  But I'm going to use the PdfCopy because I don't have to worry 
about rotation plus the page size will be the same as in the original and my 
project requires this last thing.

Here is how I used your suggestion.

----

// Create new page
document.NewPage();
pageOfCurrentReaderPDF++;
currentPageNumber++;
page = writer.GetImportedPage(pdfReader, pageOfCurrentReaderPDF);
                                               
// Check if the page needs rotation
int rotation = pdfReader.GetPageRotation(pageOfCurrentReaderPDF);
if (rotation == 90 || rotation == 270)
        cb.AddTemplate(page, 0, 1f, -1f, 0, 
pdfReader.GetPageSizeWithRotation(pageOfCurrentReaderPDF).Height, 0);
else
        cb.AddTemplate(page, 0, 0);

---


Thanks,


-----Original Message-----
From: Kevin Day [mailto:[email protected]] 
Sent: Friday, May 21, 2010 11:22 AM
To: [email protected]
Subject: Re: [iText-questions] Document rotates while merging


Common rotation matrices:

90 degree:  0 1 -1 0 <top> 0
180 degree: -1 0 0 -1 <right> <top>
270 degree: 0 -1 1 0 0 <right>


for page importing, <top> would be the page height and <right> would be the
page width.

That should do it for you.  Please post back the solution that finally works
for you.

- K
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Document-rotates-while-merging-tp2224779p2226403.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------

_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

------------------------------------------------------------------------------

_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to