Aspose Words for Android: Get page count

485 Views Asked by At

I am trying to get page count from office document on Android using Aspose:

try {
    Document doc = new Document(path);//such as: "/storage/emulated/0/Download/Document.docx"
    //Get page count                                         
    int pageCount = doc.getPageCount();

} catch (Exception e) {
    e.printStackTrace();
}

However, application stops due to fatal exception: java.lang.NoClassDefFoundError: com.aspose.words.Document

I am using jdk-1.7 and I have downloaded aspose-words-1.12-android. Please advise.

2

There are 2 best solutions below

0
On

Thanks, the issue was because I didn't include apk file into assets folder which should be done starting from 1.11 release. I just followed the post

0
On

luna kass.I think you have to install aspose-words-1.12-libs-android-jdk1x(5 or 6).apk.