I am using Aspose.PDF to convert pdf documents to PDF A with the following code:
AsposeLicenseHandler.SetAsposeLicenses(new Aspose.Words.License(), new Aspose.Pdf.License());
inStream.Position = 0;
var doc = new Aspose.Pdf.Document(inStream);
//Code to ensure distinct filename as String
if (!doc.Convert(filename, PdfFormat.PDF_A_1B, ConvertErrorAction.Delete))
throw new Exception(“Unable to convert document!”);
var outStream = new MemoryStream();
outStream.Position = 0;
This works for most PDF files, however some documents cause Aspose to throw null pointer exception. This happens with the attached PDF test.pdf. The doc.validate creates the file validaFile.xml (attached), as far as I can see there are no errors that cannot be converted.
My question is; why does Aspose throw null pointer exception on doc.Convert for test.pdf? Do you have a solution to how we can convert this document?
for using our products.<o:p></o:p>
I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-35190. We will investigate this issue in details and will keep you updated on the status of a correction.
We apologize for your inconvenience.