PdfPageSettings Size interchanges width with height when setting Orientation and vice versa

Setting Size or Orientation on PdfPageSettings swaps Width and Height.

How can we turn off this behaviour?

Sometimes we need Portrait orientation enum, but behaving as Landscape by specifying wider Width than Height.


section.PageSettings.Size = new SizeF(956, 800);

section.PageSettings.Orientation = PdfPageOrientation.Portrait;


results in Size being W:800, H:956





1 Reply 1 reply marked as answer

SV Surya Venkatesan Syncfusion Team February 4, 2022 01:31 PM UTC

Hi umlprog,


Yes. If width is greater than height, orientation will change to landscape and In this scenario, if change the orientation from landscape to portrait, then the maximum page length will be set as height and lesser length will be set as width of the PDF page. This is the behavior. We recommend you set the width and height of PdfPage accordingly.


Kindly refer to the following article for PdfPageSetting,

https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.PdfPageSettings.html


Kindly let us know if you need any further assistance with this.


Regards,

Surya V


Marked as answer
Loader.
Up arrow icon