I am asked to count the number of pages of a word document without converting it to a pdf type.
I tried 'counting the sections' method to count the number of pages, but that method proved to be inaccurate, I need to accurately count the number of pages of word document using python-docx
library.
Update - Since the documents wouldn't have anything unique to it, counting the pages using a place holder is not possible, the only unique thing to each page will be its page number as its footer.
Install the
python-docx library. You can install it like this:Here is the code: