My application stamps PDF’s on each page with details of the PDF. Most of the PDF’s are scanned documents. Some of them were scanned portrait, and others landscape. To work out where to position the stamp, I check the page height and page width. The problem is that on the pages that are landscape, the box is being put outside the image. This is rectified if I just change the Width and Height around manually.
To check whether the page is landscape, I check the Pages(x).PageInfo.IsLandscape, but this is always false, even if it is in landscape.
Another check I have been doing is the Height and Width of the mediabox. Sometimes this is set correctly. But there are then times where it isn’t.
I figure that the page height and width has nothing to do with the size and width of the image for that page, even if the image is bigger than the page. So how do I find out what the size of the image is within the page?