PageDimensions switches width and height

PageDimensions switches width and height

Forum member · Sep 29, 2010
I am baffeled by this. I creating a new PDF merge document from a file and taking the PageDimensions from page 1. When getting width and height, those are switched as if the page was landscape. When looking at the document thru Adobe Reader, all indicated that it is portrait. I can see a property for the PDFpage object that indicated rotation to be -90. I am not able to read this in runtime due to the property being private.

Re: PageDimensions switches width and height

Support · Sep 30, 2010
Hello, It looks like the page you have is in landscape mode but rotated to look as portrait. This is the reason for seeing a changed height and width. You can check if the page is rotated by using the Rotate property of the page without any problem. PdfDocument pdf = new PdfDocument(@"C:\Temp\File.pdf"); MergeDocument doc = new MergeDocument(pdf); int rotation = doc.Pages[0].Rotate; Thanks, ceTe Software Support Team.