Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Number of pages in a word doc in java

Tags:

Is there an easy way to count the number of pages is a Word document either .doc or .docx?

Thanks

like image 245
DD. Avatar asked May 17 '10 11:05

DD.


People also ask

How do I see the number of pages in a word document?

Page count with the Microsoft Word statistics window. You can access the word-count statistics pop-up window, where the Microsoft Word displays the number of pages. You can open it via the Review tab > Proofing > Word Count.

How do I read a docx file in Python?

Reading Word Documents docx file in Python, call docx. Document() , and pass the filename demo. docx. This will return a Document object, which has a paragraphs attribute that is a list of Paragraph objects.


1 Answers

You could try the Apache API for word Docs:

http://poi.apache.org/

It as a method for getting the page count:

public int getPageCount() 

Returns: The page count or 0 if the SummaryInformation does not contain a page count.

like image 192
Robben_Ford_Fan_boy Avatar answered Sep 20 '22 21:09

Robben_Ford_Fan_boy