I am trying to use doc.getPageCount() to return the total number of pages in a document but it returns incorrect page count when i use the code below
public int getDocumentPageCount(InputStream in) throws Exception
{
com.aspose.words.Document doc = new com.aspose.words.Document(in);
return (doc !=null ? doc.getPageCount() : 0);
}
but if i change the code to below, the correct page count is returned
public int getDocumentPageCount(InputStream in) throws Exception
{
com.aspose.words.Document doc = new com.aspose.words.Document("C:\temp\file.doc");
return (doc !=null ? doc.getPageCount() : 0);
}
Can you help, i need the first option to work