Can PDFNet detect whether a page is landscape or portrait?

49 views
Skip to first unread message

Aaron

unread,
Mar 28, 2016, 2:01:50 PM3/28/16
to PDFTron PDFNet SDK
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.
Reply all
Reply to author
Forward
0 new messages