-
Download iTextSharp from package manager
-
Import iTextSharp.text under namespaces
-
Now you can use invoke code with this snippet to determine whether a page in pdf is portrait or landscape
Dim Reader As New iTextSharp.text.pdf.PdfReader(pdfPath)
Dim Rect = Reader.GetPageSizeWithRotation(pageNum) 'pageNum starts at 1
out_isPortrait = Rect.Height >= Rect.Width
'if out_isPortrait = True, orientation=Portrait, else orientation=Landscape
Reusable module attached here (make sure iTextSharp package is installed first)
GetOrientationOfPDF.xaml (10.5 KB)