We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unable to set PageWith and PageHeight


It seems the page size will be always A4(8.26’x11.69’)…is it a bug or I
missed something?

Pdf pdf1 = new Pdf();
pdf1.PageSetup.PageWidth = PageSize.A2Width;
pdf1.PageSetup.PageHeight = PageSize.A2Height;


Thanks for considering Aspose.

Please try using the following code snippet to accomplish your requirement.


section.PageInfo.PageHeight = PageSize.A2Height;
section.PageInfo.PageWidth = PageSize.A2Width;

Please visit the following link for related information on how to set Set Page Size and Margins

In case it does not resolve your problem or you have any further query, please feel free to contact.

We apologize for your inconvenience.