PDF to PDF/A1b Conversion fails

Currently evaluating Aspose.NET and I’m getting an error for our target runtime environment converting PDF to PDF/A using .NET 6 on Linux.

The conversion log does report some errors, however I’m not sure if those are really supposed to prevent the conversion. The error is a null reference exception which tells me there’s a bug.

Hope all required info has been provided. thanks in advanced.

Docker Image: mcr.microsoft.com/dotnet/aspnet:6.0-focal
Publish command: dotnet publish --os linux -o publish -f net6.0

Input File
Printed to PDF from MS Word.
**input.pdf (450.5 KB)
**

Code
Practically, same as what’s in Convert PDF to PDF/A formats|Aspose.PDF for .NET

using var inputPdfFileStream = File.OpenRead(inputPdfFilename);
var document = new Document(inputPdfFileStream);
document.Convert("convert.log", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
document.Save(outputPdfFilename);

Notable Dependencies

<PackageReference Include="Aspose.Pdf.Drawing" Version="23.2.0" />
<PackageReference Include="Aspose.Drawing" Version="23.2.0" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.3" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="6.0.0" />

Error

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at #=zsIyWioK31eoifD4h0oodXWInWWa_.#=zrCMBcrA=(#=zPXg6mQVFOnGPCqr9NpHT7TlK9AG2 #=zHRtK9WqhS0SP)
   at #=zXvNf4yKsayXKe_0KW9ON_2E=.#=zR3eyU18=(#=zPXg6mQVFOnGPCqr9NpHT7TlK9AG2 #=zHRtK9WqhS0SP)
   at #=zOCd4xIp8_cLiH3soa_luoDs=.#=zR3eyU18=(#=zPXg6mQVFOnGPCqr9NpHT7TlK9AG2 #=zHRtK9WqhS0SP)
   at #=qRORQe7kwgNyo8AOmwnclh4z$TIYnPZrR5iEGYPwNPPk=.#=z3NTotJCuzcFbEqXzptaUMc_SBc2A(Object #=zFgqaTDc=)
   at #=qRORQe7kwgNyo8AOmwnclh4z$TIYnPZrR5iEGYPwNPPk=.#=ziYjxLNtJd8hDvkstXqGYJ7717enH(MethodBase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=.#=z3NTotJCuzcFbEqXzptaUMc_SBc2A(Object #=zFgqaTDc=)
   at #=qRORQe7kwgNyo8AOmwnclh4z$TIYnPZrR5iEGYPwNPPk=.#=zB6CIFzqNBQKYLUtjPY36OXQYY$CXPNNDq2cPGG8=()
   at #=qRORQe7kwgNyo8AOmwnclh4z$TIYnPZrR5iEGYPwNPPk=.#=zVhU7Ldw2U$4YLwa4lWGKR_A=(Object #=zFgqaTDc=, UInt32 #=zVSzD2c0=)
   at #=qRORQe7kwgNyo8AOmwnclh4z$TIYnPZrR5iEGYPwNPPk=.#=znNgxBVYeHIG4WYuAs$zvelk=(Boolean #=zFgqaTDc=)
   at #=qRORQe7kwgNyo8AOmwnclh4z$TIYnPZrR5iEGYPwNPPk=.#=znNgxBVYeHIG4WYuAs$zvelk=(Boolean #=zFgqaTDc=)
   at #=qRORQe7kwgNyo8AOmwnclh4z$TIYnPZrR5iEGYPwNPPk=.#=zVzlDZ1TVaS$EganeJDaK3bPbYzNPfVhmsA==(Object[] #=zFgqaTDc=, Type[] #=zVSzD2c0=, Type[] #=zip_JpN8=, Object[] #=zHNsDfyY=)
   at #=qRORQe7kwgNyo8AOmwnclh4z$TIYnPZrR5iEGYPwNPPk=.#=zhbn$lUGzNdOHnbIIiK2GWNXou0sap5uCEQpCcY1z_K9i(Stream #=zFgqaTDc=, String #=zVSzD2c0=, Object[] #=zip_JpN8=)
   at #=qRORQe7kwgNyo8AOmwnclh4z$TIYnPZrR5iEGYPwNPPk=.#=zCcJBgRLXEFS4uMhrK8xLiumYqeyF(Stream #=zFgqaTDc=, String #=zVSzD2c0=, Object[] #=zip_JpN8=)
   at Aspose.Pdf.Document.#=zHSU7TJ1r2p51(Stream #=z4RwsdAs=, SaveOptions #=zgCO5VhJBUdNb)
   at Aspose.Pdf.Document.#=zDrdlOuY__GWo(String #=zUbtl7rocKtHR)
   at Aspose.Pdf.Document.Save(String outputFileName)

Logs

<Compliance Name="Log" Operation="Validation" Target="PDF/A-1B">
	<Version>1.0</Version>
	<Copyright>Copyright (c) 2001-2023 Aspose Pty Ltd. All Rights Reserved.</Copyright>
	<Date>03/02/2023 11:29:35</Date>
	<File Version="1.7" Name="" Pages="1">
		<Security />
		<Catalog />
		<Header />
		<Annotations />
		<Fonts>
			<Problem Severity="Error" Clause="6.3.6" ObjectID="19" Page="1" Convertable="True">Width information for glyphs is inconsistent in embedded font 'CIDFont+F2'</Problem>
			<Problem Severity="Error" Clause="6.3.6" ObjectID="35" Page="1" Convertable="True">Width information for glyphs is inconsistent in embedded font 'CIDFont+F4'</Problem>
		</Fonts>
		<trailer>
			<Problem Severity="Error" Clause="6.1.3" Convertable="True">The trailer dictionary does not contain 'ID'</Problem>
		</trailer>
		<Metadata>
			<Problem Severity="Error" Clause="6.7.11" Convertable="True">Required property 'pdfaid:part' for schema 'pdfaid' missing</Problem>
			<Problem Severity="Error" Clause="6.7.11" Convertable="True">Required property 'pdfaid:conformance' for schema 'pdfaid' missing</Problem>
		</Metadata>
		<objects />
		<xObjects />
		<actions />
	</File>
</Compliance>

@ILikeCranberries

Would you kindly make sure that all Windows Fonts are properly installed along with libgdiplus package. Also, please try using Aspose.PDF.Drawing from NuGet instead of Aspose.PDF and see if issue still occurs. In case issue persists, please let us know.

Thank you for your response, Asad.

As indicated in my original post, I used Aspose.Pdf.Drawing. I had just installed ttf-mscorefonts-installer to my docker container and received the same error and very similar log content.

RUN apt-get update && apt-get -y install ttf-mscorefonts-installer libgdiplus

@ILikeCranberries
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-53788

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thank you, Asad.