Free Support Forum -

Converting PDF- Convert(filename-PdfFormat.PDF_A_1B


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
doc.Validate(filename, PdfFormat.PDF_A_1B);
if (!doc.Convert(filename, PdfFormat.PDF_A_1B, ConvertErrorAction.Delete))
throw new Exception(“Unable to convert document!”);
var outStream = new MemoryStream();
outStream.Position = 0;
return outStream;

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?

Hi Muri,

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>Thanks
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.

The issues you have found earlier (filed as PDFNEWNET-35190) have been fixed in Aspose.Pdf for .NET 8.0.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.