tags:

views:

138

answers:

3

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

Thanks

+2  A: 

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.

David Relihan
+2  A: 

Use Apache POI's SummaryInformation to fetch the Total page count of a MS word document

Snehal
+1  A: 

Use Apache POI. Check this link

http://poi.apache.org/apidocs/org/apache/poi/hpsf/wellknown/PropertyIDMap.html#PID_PAGECOUNT

RaviG