ststeiger / PdfSharpCore

Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
Other
1.05k stars 234 forks source link

Exception #369

Closed Ervin304 closed 1 year ago

Ervin304 commented 1 year ago

Could you please check this exception. Ia appears partially and I do not think that the my implementation has any Influence on it. It happens when I create the same PDF file for the second time. The first time it works fine, but the second time I get this error. I use two PdfDocument instances, of course

Exception: An item with the same key has already been added. Key: 3 0 at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at PdfSharpCore.Pdf.Advanced.PdfCrossReferenceTable.Compact() at PdfSharpCore.Pdf.PdfDocument.PrepareForSave() at PdfSharpCore.Pdf.PdfDocument.DoSave(PdfWriter writer) at PdfSharpCore.Pdf.PdfDocument.Close()