The pages of my Pdf actually are in landscape mode…
But how can I detect this.
My goal is simply to initialize a PngDevice in order to export Pages with their original ratio.
Below is the PageInfo I obtain…
According to pdf generation - How to find whether PDF has landscape orientation or portrait - Stack Overflow, the IsLandscape
property (and IMO the PageInfo.Width/Height) seems not to be correctly infered by Aspose…
I understand that all those Rects are not simple to “integrate” into one “simple final Rect for the Page”. I thought that the PageInfo SHOULD hold the result of this subtle computation…
In order to determine if the source PDF file is in Landscape orientation or Portrait, you need to get the page dimensions and compare the values. If Page width is greater than page height, it indicates that page is in Landscape mode. The following code snippet can be used to get the page dimensions.
The default unit is point and in order to convert the values to inches, we need to divide the values by 72.
But I am afraid the current version of Aspose.Pdf for .NET has some issues while returning page dimensions information. For
the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-36818. We will
investigate this issue in details and will keep you updated on the status of a
correction.