Hello,
I try to read a PDF file using Aspose.PDF for Java 18.3, and I get the following traceback:
Exception in thread "main" class com.aspose.pdf.exceptions.CrossTableNotFoundException: Cross reference table or cross refference stream not found
com.aspose.pdf.internal.l4l.I41.lI(Unknown Source)
com.aspose.pdf.PageCollection.size(Unknown Source)
com.aspose.pdf.PageCollection.l1(Unknown Source)
com.aspose.pdf.PageCollection.<init>(Unknown Source)
com.aspose.pdf.ADocument.l1If(Unknown Source)
com.aspose.pdf.ADocument.lif(Unknown Source)
com.aspose.pdf.ADocument.<init>(Unknown Source)
com.aspose.pdf.Document.<init>(Unknown Source)
src.PDFMain.main(PDFMain.java:11)
at com.aspose.pdf.internal.l4l.I41.lI(Unknown Source)
at com.aspose.pdf.PageCollection.size(Unknown Source)
at com.aspose.pdf.PageCollection.l1(Unknown Source)
at com.aspose.pdf.PageCollection.<init>(Unknown Source)
at com.aspose.pdf.ADocument.l1If(Unknown Source)
at com.aspose.pdf.ADocument.lif(Unknown Source)
at com.aspose.pdf.ADocument.<init>(Unknown Source)
at com.aspose.pdf.Document.<init>(Unknown Source)
at src.PDFMain.main(PDFMain.java:11)
I guess that the file I try to open is not entirely valid, as it is not openable by Acrobat Reader 2017, however it opens in Mozilla Firefox (using Adobe PDF plugin). Still, we get multiple files like this from a publisher (I have around 70 files with this problem), so we’d like to know if there is a reason that Aspose cannot process them, or it can be fixed in further versions.
My code is as follows:
package src;
import com.aspose.pdf.Document;
import com.aspose.pdf.License;
public class PDFMain {
public static void main(String[] args) throws Exception {
License l = new License();
l.setLicense("Aspose.Total.Java.lic");
Document doc = new Document("file1.pdf");
}
}
A sample PDF file that causes this problem is file1.pdf.
Thanks!