Word Document Page Setup options

Hi Support Team,
I need to get Paper size in inch programatically using ASPOSE word. Please refer attached screen.
I am interested only in getting width in inch format. Please reply asap.
Thanks

Hi Divesh,

Thanks for your inquiry. The PageSetup class represents the page setup properties of a section. PageSetup object contains all the page setup attributes of a section (left margin, bottom margin, paper size, and so on) as properties. You can get the Paper size by PageSetup.PaperSize property. Please read the list of paper sizes from here:
https://reference.aspose.com/words/net/aspose.words/papersize/

The PageSetup.PageWidth returns the width of the page in points. Please use the following code snippet to achieve your requirements.

Document doc = new Document(MyDir + "in.docx");
DocumentBuilder builder = new DocumentBuilder();
PageSetup ps = builder.PageSetup;
Console.Write(ps.PaperSize.ToString());
Console.Write(ConvertUtil.PointToInch(ps.PageWidth).ToString());

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.