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

Free Support Forum - aspose.com

Get line spacing for a specific page in a docx document

I want to open a .docx document that has been already written by someone in word and get the line spacing for a specific page in that document. Is it possible?

I know that there is this property builder.ParagraphFormat.LineSpacingRule but I want to know how I can use it to get the line spacing that is used for page 2 out of 20, for example.

My document has a different line spacing for the title and for other pages, and that is why I want to get the line spacing for a specific page.

@JohnAxe754,
Please use the Document.ExtractPages method to extract a particular page from your document:

Document doc = new Document(@"C:\Temp\in.docx");
Document secondPage = doc.ExtractPages(1, 1);

Paragraph firstParagraph = (Paragraph)secondPage.GetChild(NodeType.Paragraph, 0, true);
Console.WriteLine(firstParagraph.ParagraphFormat.LineSpacingRule);
Console.WriteLine(firstParagraph.ParagraphFormat.LineSpacing);