We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Setting a page size

How do you set a custom page width and height?

I am using version 7.2

1 Reply

BP Bhuvaneswari P Syncfusion Team May 11, 2009 12:44 PM UTC

Hi,

Thank you for using Syncfusion Software.

Please use the below code snippet to set predefined and custom page size

PdfDocument doc = new PdfDocument();

//To set predefine page size
doc.PageSettings.Size = PdfPageSize.B2;

//To set custom page size
doc.PageSettings.Size = new SizeF(400, 400);
doc.Pages.Add();

Also, in Essential PDF everything is Point based, so please specify the units in Points. For more information regarding PDF units please refer the below URL.
http://help.syncfusion.com/ug_72/pdf/SetGraphicUnits.html

Best Regards,
Bhuvana

Loader.
Live Chat Icon For mobile
Up arrow icon