Convert PDF to PDF/A in C# using Aspose.PDF for .NET - Object reference error occurs

Hello,

When trying to convert a PDF to a new format with the following C# line:

        Document doc = new Document(fullFilePath);
        bool success = doc.Convert(new MemoryStream(), PdfFormat.PDF_A_1A, ConvertErrorAction.Delete);

I got the following error:

ERROR 2020-01-28 11:11:49,821 135413ms LogHelper LogException - Unexpected exception while process eleve with NBDS ID = 02304065 : Object reference not set to an instance of an object.
Stack trace : at #=zQJkE9Lf6vNZzWxdK0PxKoNHBTW$xjlgi69b6AiT71lv4ok8y6g==.#=zxB$rhOgXDAU9(#=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5 #=z14jXrl8=, #=zHLWW2byG7BaesBhZQERbj6lipKwL5vNaqDL4v8lzQpmT #=zZVVNJMAUIaV0yF0uWA==, Resources #=zLBqwSTs=)
at #=zQJkE9Lf6vNZzWxdK0PxKoNHBTW$xjlgi69b6AiT71lv4ok8y6g==.#=zxB$rhOgXDAU9(#=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5 #=z14jXrl8=, Resources #=zLBqwSTs=)
at Aspose.Pdf.ImagePlacementAbsorber.#=zsXhYfl4=(Page #=zlkdvl1c=, OperatorCollection #=zvY61pUg=, Resources #=zLBqwSTs=)
at Aspose.Pdf.ImagePlacementAbsorber.#=zsXhYfl4=(Page #=zlkdvl1c=, OperatorCollection #=zvY61pUg=, Resources #=zLBqwSTs=)
at Aspose.Pdf.ImagePlacementAbsorber.#=zkNlYWlM=(Page #=zlkdvl1c=, OperatorCollection #=zvY61pUg=, Resources #=zLBqwSTs=)
at Aspose.Pdf.ImagePlacementAbsorber.Visit(Page page)
at #=zToxjQLUXKtzCGBHprUvZHcOAXXCAJ6ED4rtgmEwdSVdJlxILOy0YMPM=.#=zsXp2gpI2dDv1(String #=zoyszHzXrc4th, String #=zWjO1lFYFIC1A)
at #=zOru0ILM6VHVpDB_3zRdS2E5c9KmM9I0ja9afLjXR0Oq6MetpC6B9M3U=.#=zvlwfVNH2wHUQ()
at #=zOru0ILM6VHVpDB_3zRdS2E5c9KmM9I0ja9afLjXR0Oq6MetpC6B9M3U=.#=zSe$wFGbpKcRl()
at #=zToxjQLUXKtzCGBHprUvZHcOAXXCAJ6ED4rtgmEwdSVdJlxILOy0YMPM=.#=zFBEhJcE=()
at #=zOru0ILM6VHVpDB_3zRdS2E5c9KmM9I0ja9afLjXR0Oq6MetpC6B9M3U=.#=zkNlYWlM=(XmlTextWriter #=z3436xhQ=, PdfFormat #=zZTydn1M=, Document #=z_R$Qewk=, Boolean #=zXwi2sefbEagR, ConvertErrorAction #=zMpL7e7A=)
at Aspose.Pdf.Document.#=zkwsBd5Q=(XmlTextWriter #=z3436xhQ=, PdfFormat #=zZTydn1M=, Boolean #=zXwi2sefbEagR, ConvertErrorAction #=zMpL7e7A=)
at Aspose.Pdf.Document.Convert(Stream outputLogStream, PdfFormat format, ConvertErrorAction action)
at ELCA.CRM.SISE.Common.PdfHelper.ConvertToPdfA(String fullFilePath, String fullTargetFilePath) in C:\Users\drs\PdfHelper.cs:line 62
at ELCA.CRM.SISE.ArchiveEleve.Program.ProcessEleves(List`1 eleves) in C:\Users\drs\Program.cs:line 177

System.NullReferenceException: Object reference not set to an instance of an object.
at #=zQJkE9Lf6vNZzWxdK0PxKoNHBTW$xjlgi69b6AiT71lv4ok8y6g==.#=zxB$rhOgXDAU9(#=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5 #=z14jXrl8=, #=zHLWW2byG7BaesBhZQERbj6lipKwL5vNaqDL4v8lzQpmT #=zZVVNJMAUIaV0yF0uWA==, Resources #=zLBqwSTs=)
at #=zQJkE9Lf6vNZzWxdK0PxKoNHBTW$xjlgi69b6AiT71lv4ok8y6g==.#=zxB$rhOgXDAU9(#=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5 #=z14jXrl8=, Resources #=zLBqwSTs=)
at Aspose.Pdf.ImagePlacementAbsorber.#=zsXhYfl4=(Page #=zlkdvl1c=, OperatorCollection #=zvY61pUg=, Resources #=zLBqwSTs=)
at Aspose.Pdf.ImagePlacementAbsorber.#=zsXhYfl4=(Page #=zlkdvl1c=, OperatorCollection #=zvY61pUg=, Resources #=zLBqwSTs=)
at Aspose.Pdf.ImagePlacementAbsorber.#=zkNlYWlM=(Page #=zlkdvl1c=, OperatorCollection #=zvY61pUg=, Resources #=zLBqwSTs=)
at Aspose.Pdf.ImagePlacementAbsorber.Visit(Page page)
at #=zToxjQLUXKtzCGBHprUvZHcOAXXCAJ6ED4rtgmEwdSVdJlxILOy0YMPM=.#=zsXp2gpI2dDv1(String #=zoyszHzXrc4th, String #=zWjO1lFYFIC1A)
at #=zOru0ILM6VHVpDB_3zRdS2E5c9KmM9I0ja9afLjXR0Oq6MetpC6B9M3U=.#=zvlwfVNH2wHUQ()
at #=zOru0ILM6VHVpDB_3zRdS2E5c9KmM9I0ja9afLjXR0Oq6MetpC6B9M3U=.#=zSe$wFGbpKcRl()
at #=zToxjQLUXKtzCGBHprUvZHcOAXXCAJ6ED4rtgmEwdSVdJlxILOy0YMPM=.#=zFBEhJcE=()
at #=zOru0ILM6VHVpDB_3zRdS2E5c9KmM9I0ja9afLjXR0Oq6MetpC6B9M3U=.#=zkNlYWlM=(XmlTextWriter #=z3436xhQ=, PdfFormat #=zZTydn1M=, Document #=z_R$Qewk=, Boolean #=zXwi2sefbEagR, ConvertErrorAction #=zMpL7e7A=)
at Aspose.Pdf.Document.#=zkwsBd5Q=(XmlTextWriter #=z3436xhQ=, PdfFormat #=zZTydn1M=, Boolean #=zXwi2sefbEagR, ConvertErrorAction #=zMpL7e7A=)
at Aspose.Pdf.Document.Convert(Stream outputLogStream, PdfFormat format, ConvertErrorAction action)
at ELCA.CRM.SISE.Common.PdfHelper.ConvertToPdfA(String fullFilePath, String fullTargetFilePath) in C:\Users\drs\PdfHelper.cs:line 62
at ELCA.CRM.SISE.ArchiveEleve.Program.ProcessEleves(List`1 eleves) in C:\Users\drs\Program.cs:line 177

Any ideas? I’m working on making the PDF available for everyone - it contains private information.
But if in the meantime someone has already experienced similar issue, thanks in advance.

Best regards,
Danny Rodrigues

@DRA

Would you kindly share your sample PDF document with so that we can test the scenario in our environment and address it accordingly.

Hi @asad.ali

@DRA is currently on vacation. I sent you the PDF privately, as it contains personal data. Thanks

@DamienCH

Thanks for sharing the file in private message.

We have tested the scenario in our environment using Aspose.PDF for .NET 20.1 and were able to replicate the issue. We have logged it as PDFNET-47655 in our issue tracking system for further investigation. We will look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

@asad.ali

Thanks for the reply. What’s the usual time to fix this kind of issue?
We’d like to know if we have to wait few weeks (which we could manage), or if we should expect more like several months (and thus have to find a workaround).

Thanks.

@DamienCH

Thanks for your inquiry.

Please note that the issue was logged under free support model where issues have low priority and are resolved on a first come first serve basis. The resolution time of the issue may depend upon the number of issues logged prior to it unlike the priority support where issues have high priority and are resolved on an urgent basis.

We will surely inform you as soon as we have some definite updates regarding issue resolution or its ETA. Please spare us little time.

We are sorry for the inconvenience.

Hi @asad.ali, any update on this issue?

@DamienCH

Regretfully the issue is not yet resolved. We will surely inform you as soon as we have some certain news on its resolution. Please spare us some time.

We are sorry for the inconvenience.

Hi @asad.ali ,

It has already been 3 months. I understand it’s not a priority issue, but could we get a rough ETA estimate? Will it be in 2020?

Thanks.

@DamienCH

We regret to share that we are not in a position to share any reliable ETA due to other high priority pending tasks. However, we have recorded your concerns and will surely consider them during issue investigation. We will inform you as soon as we have some news about resolution ETA. Please spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-47655) have been fixed in Aspose.PDF for .NET 20.8.