Third party jar is throwing some binary error

Hi Team,

The third party jar is throwing binary error while using the pdf file(which was generated from word file to pdf file using aspose utility).

Document document = new Document(“wordFile/path”);
document.setWarningCallback(iWarningCallback);
document.save(outputPdfFilePath, pdfSaveOptions);

Please find the attached zip in which fonts, word, pdf file is present.

Third party LIB: (PDFBOX) :When we are using pdf box to get the pdf. It throws the binary exception for pdf(attached in zip).

Please help to check the aspose utility while converting word into pdf.
aspose.words --24.3-jdk17
aspose.pdf --23.11-jdk17
Java: JDK17

Code snippet:

byte[] fileBytes = Files.readAllBytes(Paths.get(“C:\path\PDF_file.pdf”));

PDDocument d = PDDocument.load(fileBytes);

Issue_PDF_BOX.zip (3.2 MB)

@forasposeissues

If PDFBox is the API that is throwing an error, we are afraid that we cannot investigate why it is happening. Have you tried loading the same PDF document using Aspose.PDF API? Is it throwing an exception also?

No, we haven’t tried loading the pdf document using Aspose utility. Since, we are using PDFBox utility for the same. I hope PDFBox should not raise any issue. Because we are using the PDFbox to load the different PDF document (generated by aspose utility), and that works fine.

Team please help here.

Appreciate for help.

@forasposeissues

  1. We are afraid that we cannot investigate an issue that is not being caused by Aspose APIs. We believe that you should report it to PDFBox support forums if PDFBox is throwing some error.

  2. Please note that Aspose.Words mimics the behavior of MS Word and it generated PDF files in the same way like you would generate using MS Word. Please try using MS Word to generate a PDF file from same Word file and open it using PDFBox, if it shows different behavior, please let us know so that we may further proceed accordingly.