How to get MS Word total pages count using Open XML SDK?
问题 I am using below code to get the page count but it is not giving actual page count(PFA). What is the better way to get the total pages count? var pageCount = doc.ExtendedFilePropertiesPart.Properties.Pages.Text.Trim(); Note: We cannot use the Office Primary Interop Assemblies in my Azure web app service Thanks in advance. 回答1: In theory, the following property can return that information from the Word Open XML file, using the Open XML SDK: int pageCount = (int) document