Hello, I'm trying out the DevCraft trial to do conversion from pdf to pdfa, however the .Export method throws a nullreference exception far inside the Telerik-components. Not sure how to proceed, since the error tells me nothing.
I followed the example shown here: https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/howto/comply-with-pdfa-standard
The exception thrown:
The type initializer for 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.ColorSpaces.IccProfileObject' threw an exception. at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.ColorSpaces.IccProfileObject.get_SRgbProfile() at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.OutputIntent..ctor() at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.DocumentCatalog.CopyPagePropertiesFrom(IRadFixedDocumentExportContext context) at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.DocumentCatalog.CopyPropertiesFrom(IRadFixedDocumentExportContext context) at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfExporter.Export(IRadFixedDocumentExportContext context, Stream output) at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.ExportOverride(RadFixedDocument document, Stream output) at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Export(T document, Stream output) at Telerik.Windows.Documents.Common.FormatProviders.BinaryFormatProviderBase`1.Export(T document) at PdfaConverter.Tjenester.Converters.PdfConverter.ConvertToPdfa(string base64) in E:\Repositories\PdfaConverter\PdfaConverter\Tjenester\Converters\PdfConverter.cs:line 21 at ConsoleTest.Program.Konverter(String inputPath, String outputPath, IConverter converter, String filetype) in E:\Repositories\PdfaConverter\ConsoleTest\Program.cs:line 51 at ConsoleTest.Program.KonverterPdfToPdfa() in E:\Repositories\PdfaConverter\ConsoleTest\Program.cs:line 24 at ConsoleTest.Program.Main(String[] args) in E:\Repositories\PdfaConverter\ConsoleTest\Program.cs:line 17
My code:
public string ConvertToPdfa(string base64){ PdfFormatProvider provider = new PdfFormatProvider(); var document = provider.Import(Convert.FromBase64String(base64)); PdfExportSettings settings = new PdfExportSettings(); settings.ComplianceLevel = PdfComplianceLevel.PdfA2B; provider.ExportSettings = settings; return Convert.ToBase64String(provider.Export(document));}