Can PDFNet detect whether a page is landscape or portrait?

Q:

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?

A:

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

http://www.pdftron.com/pdfnet/PDFNet/html/M_pdftron_PDF_Page_GetPageWidth.htm
http://www.pdftron.com/pdfnet/PDFNet/html/M_pdftron_PDF_Page_GetPageHeight.htm

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