How do I determine if I need to flip/rotate an image I get from a PDF?

Q: How do I determine if I need to flip/rotate an image I get from a
PDF
file? From the matrix? I want to draw an image I get out of the PDF
file
----
A: Are you referring to PDFDraw.GetBitmap() or Image.GetBitmap() -
i.e. are you looking how to transform the entire page or a specific
image that is used on a page? In the latter case, the orientation
(transformation) of the image on the page can be obtained from image
element (element.GetCTM()). The orientation of the entire page is a
bit more tricky - page.GetDefaultTransform() will transform the page
to what you can see on the screen, however it does not guarantee that
the orientation is correct (i.e. the page might have been
intentionally rotated, it may contain some content upside down/some
not, etc).