i have a docx file (please see the attachment), i use the below code to get pagecount:
var doc = new Aspose.Words.Document(fileFullName);
int pageCount = doc.PageCount;
for (int page = 0; page < pageCount; page++)
{
// Save each page as a separate document.
var extractedPage = doc.ExtractPages(page, 1);
var toFileName = Path.Combine(@"O:\", $"SplitDocument.PageByPage_{ page + 1}.docx");
extractedPage.Save(toFileName);
}
the pagecount property returns 2 which is incorrect, and i separated the document to 2 docs file please also see the attments.
i dont know what’s wrong with my codes, can you please help me to find out why the pagecount property is not incorrect.
thank you very much.
SplitDocument.PageByPage_1.docx (16.9 KB)
SplitDocument.PageByPage_2.docx (16.4 KB)
common_FOOTER-Final.docx (22.9 KB)