I am making a program for a friend of mine wich must extract images from a
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
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.