Can PDFNet detect whether a page is landscape or portrait?


I want to process PDF pages automatically. The processing is different if I’m processing pages with landscape orientation and not portrait orientation. Is there any way to detect a page’s orientation?


You can detect a page’s current orientation with Page.GetPageWidth() and Page.GetPageHeight():

If Page.GetPageWidth() > Page.GetPageHeight(), the page is currently in landscape mode. Otherwise, it’s currently in portrait mode.