Using Aspose PDF for .NET (v20.1.0) to convert a multi-layer PDF to PDF/A-2B churns for a very long time and then throws an exception.
Testfile used
Plankart Multi Layer.pdf (2.8 MB)
Postman screenshot of conversion test
psotman failed request PDFA-2B.png (39.0 KB)
The code used for conversion is very simple:
doc.Convert(logStream, PdfFormat.PDF_A_2B, ConvertErrorAction.Delete);
doc.Info.ModDate = DateTime.Now;
var options = new Aspose.Pdf.PdfSaveOptions
{
WarningHandler = Instance.CustomPdfWarningHandler ?? new HandlePdfWarnings()
};
doc.Save(destination, options);
The error message (part I can share) is below. Can’t do much about the content.
System.ArgumentException: An item with the same key has already been added. Key: 4294967295
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at #=zt9lq3Ay5DNvj2qMc_ohw4QgBz2GzHyT8sjy$gX9e2Nc8Lb4gho4FF1sigu5I.#=zl0skfbIW14HT()
at #=zPVmLPn3gtBa4QVKez_aeMdr6L6rUcrK_PZ$YccHsCv2T$eBC78dcrD8=.#=ztM2lXNQKEV9v(#=zxKfDCzq4uoYqestBGBCc24AUgCkScZvW2oyzmlL3i5PnqrBpBg== #=zJ51QdV4=, #=zu5eBw$LK3$Wzlx6oianc0KMvTnw32n$qAUOd3cB26JztJOhzKw== #=zWbIxiw$pHJU3)
at #=zPVmLPn3gtBa4QVKez_aeMdr6L6rUcrK_PZ$YccHsCv2T$eBC78dcrD8=.#=zw5BHfzw=()
at #=zPVmLPn3gtBa4QVKez_aeMdr6L6rUcrK_PZ$YccHsCv2T$eBC78dcrD8=.#=zTJ$iMCM=()
at #=zYHASK$I86ILLk06riQieclyzPmtgUT4NfskPhqKKGsmkjsS02$BZOh0=.#=zxxbd_i0=()
at #=zPVmLPn3gtBa4QVKez_aeMdr6L6rUcrK_PZ$YccHsCv2T$eBC78dcrD8=.#=zv3hrXjw=(XmlTextWriter #=z1MvBJzo=, PdfFormat #=zVcazA98=, Document #=zWmeYnso=, Boolean #=zrj2hjrCCPa_S, ConvertErrorAction #=zMoukO9s=)
at Aspose.Pdf.Document.#=zZzZdu9I=(XmlTextWriter #=z1MvBJzo=, PdfFormat #=zVcazA98=, Boolean #=zrj2hjrCCPa_S, ConvertErrorAction #=zMoukO9s=)
at Aspose.Pdf.Document.Convert(Stream outputLogStream, PdfFormat format, ConvertErrorAction action)