0

I have tried the approach of finding the page count in the docProps/app.xml file but this isn't very robust as the values can be easily manipulated. As I require this functionality for a website, I can't use win32com.client because it only works on Windows with Word installed.

Is there a reliable way of finding the page count using Python?

a327s
  • 1
  • 2
  • You could read the whole document with python-docx to a string and then count the words. – scenox Dec 25 '20 at 20:35
  • Does this answer your question? [How to access OpenXML content by page number?](https://stackoverflow.com/questions/39992870/how-to-access-openxml-content-by-page-number) – kjhughes Dec 26 '20 at 14:49
  • Page count is a property dependent upon the pagination algorithm of the processing software. Simulating Word's (or any other software's) pagination is complex, so your question is simple, but its answer is not. See [How to access OpenXML content by page number?](https://stackoverflow.com/questions/39992870/how-to-access-openxml-content-by-page-number) – kjhughes Dec 26 '20 at 14:56

0 Answers0