On 4/10/2011 19:04, Tom Berchenbriter wrote:

Im struggling here, my app is rotating the image of this invoice incorrectly. What should I change? I think this is the right place in the code that's rotating this, but I need it to not. Its correct on the original.


When I look at the PDF you've attached, I see that the rotation is 270 degrees. When I look at your code, I see that you obtain that rotation, but I don't see you rotating the imported page anywhere: you're using 1, 0, 0, 1 for the a, b, c, d value of the rotation matrix. If you're not familiar with the algebra, you may want to wrap the PdfImportedPage in an Image object, and use the setRotationDegrees() method of the image.

                        page = writer.GetImportedPage(reader, i);

                        rotation = reader.GetPageRotation(i);

//if (rotation == 90 || rotation == 270)

//{

// cb.AddTemplate(page, 0, -1f, 1f, 0, 0, reader.GetPageSizeWithRotation(i).Height);

//}

//else

//{

                        cb.AddTemplate(page, 1f, 0, 0, 1f, 0, 0);

In the line about, you're using the identity matrix, even if rotation isn't equal to 0!
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to