John van de Pol wrote
> I am making a program for a friend of mine wich must extract images from a
> pdf.
> 
> All the images are upside down, they are NOT rotated!!

The reason simply is that the images ARE upside-down in the page resources
and are then flipped back up by the transformation matrix active when the
image is drawn.

The image data you store are from the page resources, no transformations
applied. If you want to know if some extraordinary transformation is applied
to it afterwards, you also have to check the renderInfo.GetImageCTM - the
current transformation matrix at the time the image is drawn.

E.g. in your case the top image is drawn using the instructions

604.29 0 0 -851.16 0 839 cm
/I0 Do

I.e. it is stretched to 604.29 units horizontally and -851.16 units
vertically, and that negative value for the y coordinate implies mirroring
the image resource upside-down.

To get an image exactly as rendered, you have to apply the equivalent
transformation to the image data you have retrieved using image processing
code.

Regards,   Michael



--
View this message in context: 
http://itext.2136553.n4.nabble.com/Extracted-images-are-upside-down-tp4660992p4660993.html
Sent from the iText mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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