We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose license issue while text extraction

Hi,

We have a full license for “Aspose.Total for Java” and while extracting text from pdf, I am getting this error-
“At most 4 elements (for any collection) can be viewed in evaluation mode”

Code that throws exception-

    Document pdfDoc = new Document(source.toFile().toString());
    List<File> splitFiles = new ArrayList<>();
    for (int pdfPage = 1; pdfPage <= pdfDoc.getPages().size(); pdfPage++) {
        Document newDocument = new Document();
        newDocument.getPages().add(pdfDoc.getPages().get_Item(pdfPage));
        final Path absolutePath = dest.resolve("./index_page_" + (pdfPage) + ".pdf").toAbsolutePath();
        newDocument.save(absolutePath.toFile().toString());
        splitFiles.add(absolutePath.toFile());
    }

And here’s the stacktrace-

at com.aspose.pdf.AnnotationCollection$z3.hasNext(Unknown Source) ~[aspose-pdf-17.8.jar:17.8]
at com.aspose.pdf.PageCollection.m1(Unknown Source) ~[aspose-pdf-17.8.jar:17.8]
at com.aspose.pdf.PageCollection.m1(Unknown Source) ~[aspose-pdf-17.8.jar:17.8]
at com.aspose.pdf.PageCollection.add(Unknown Source) ~[aspose-pdf-17.8.jar:17.8]

How can I fix this issue?

Thanks,

@nisargtanna

Would you kindly make sure that you are setting license for Aspose.PDF as well separately. In case you still face any issue, please share your license file and sample PDF in a private message so that we can further investigate. You may send a private message by clicking over username and pressing blue Message button.

@nisargtanna

Thanks for sharing license file in private message.

We have tested the scenario in our environment and were unable to notice any issue. For your kind reference, output PDF documents are also attached. We used 17.11 version in our environment which was the latest one that your license supported.

output_1.pdf (61.8 KB)
output_2.pdf (59.0 KB)

Would you kindly share a console application that is able to reproduce the issue that you are facing? We will again test the scenario in our environment and address it accordingly.

@asad.ali

Thanks for confirming. The Aspose-pdf package version we are using is 17.8. You mentioned “We used 17.11 version in our environment which was the latest one that your license supported.”. Does it mean that the license that I messaged you won’t work with version 17.8 that I have? If yes, then do we need to get a new license for 17.8 version Aspose package?

Thanks,

@nisargtanna

No, this does not mean that your license would work only with 17.11. In fact your license is valid with all versions of the API released before/within the license expiry date. As per your license expiry date, 17.11 version is the latest one which got released before it and it is always recommended to use latest version which was why we tested the scenario with it. We request you to please try your scenario with 17.11 and share your feedback with us.