Hi All,
I want to write a java method which return with number of page of m$ word
document. I can see in the api that there is a
org.apache.poi.hpsf.SummaryInformation.getPageCount() method.
*This is my code:
*
public static void main(String[] args) throws Exception
{
String filename = "General_Partnership_Agreement.doc";
POIFSFileSystem fs = new POIFSFileSystem( new
FileInputStream(filename) );
HWPFDocument doc = new HWPFDocument(fs);
//System.out.println( doc.getSummaryInformation().getCharCount() );
System.out.println( doc.getSummaryInformation().getPageCount() );
}
This code does not throw any exception, but it is not working very well,
because getPageCount() always return to 1. I tried it to lots of *.doc
files, but the value of getPageCount was always 1.
Could you tell me what is the wrong in my code?
Thank you very much, zappee