Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Jul 16, 2019 8:55 am

Hello,

We are getting exception while printing pdf using spire.pdf "An item with the same key has already been added". Following is the stack trace of the issue. This issue is sporadically reproduced.
We are using spire pdf 5.3.8.2046 version.

InnnerException: An item with the same key has already been added.
Stack Trace: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at sprḌ.ᜄ()
at sprḌ.ᜁ(Single A_0)
at sprḌ.ᜂ(Single A_0)
at spr⃿.ᜀ(Graphics A_0, spr᳒ A_1, Boolean A_2)
at spr⃿.ᜁ(Graphics A_0, spr᳒ A_1, Boolean A_2)
at spr᳒.ᜀ(String A_0, sprḌ A_1, String A_2, Boolean A_3)
at spr᳒.ᜀ(String[] A_0, String A_1)
at spr᳒.ᜀ(sprỸ A_0)
at spr᳒.ᜆ(Boolean A_0)
at spr᳒.ᜥ()
at sprᝅ.ᜀ(Graphics A_0, spr᭛ A_1, spr᳒ A_2)
at spr᳒.ᜀ(sprᦕ A_0, sprᦕ A_1, RectangleF A_2, Int32 A_3, String A_4)
at spr᳒.ᜀ(sprᦕ A_0, RectangleF A_1, String A_2)
at spr᳒.ᜀ(sprᤳ A_0)
at spr᳒.ᜆ(Boolean A_0)
at spr᳒.ᜥ()
at sprោ.ᜀ(PrintPageEventArgs A_0, PdfPageBase A_1, RectangleF A_2)
at sprោ.ᜂ(PrintPageEventArgs A_0)
at sprោ.ᜀ(Object A_0, PrintPageEventArgs A_1)
at System.Drawing.Printing.PrintDocument.OnPrintPage(PrintPageEventArgs e)
at System.Drawing.Printing.PrintDocument._OnPrintPage(PrintPageEventArgs e)
at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at sprោ.ᜅ()
at Spire.Pdf.PdfDocument.Print()

Can you please look into this issue?

Thanks and Regards,
Bharat Bodage

bharatbodage
 
Posts: 21
Joined: Thu Feb 07, 2019 7:25 am

Tue Jul 16, 2019 9:09 am

Hello,

Thanks for your inquiry.
At present, our latest version is Spire.PDF Pack Version:5.7 (Spire.Pdf.dll: 5.7.0.2046). As for your situation, I prefer to recommend that you try again with the latest version. If your issue still occurs after trying, please provide your testing file as well as your full testing code to help further look into it. You could send them to us via email ([email protected]).

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Tue Jul 16, 2019 10:17 am

Can you please first analyse your code, in which cases you are adding same key again in the collection and check given stack trace?

bharatbodage
 
Posts: 21
Joined: Thu Feb 07, 2019 7:25 am

Wed Jul 17, 2019 3:56 am

Hello,

Thanks for your feedback.
We did analysis based on the stack trace you provided, but we still didn't find the accurate reason of your issue. Maybe your PDF document contains special element or structures. I’m afraid it is hard to provide an accurate solution without your PDF document. Don’t worry, we promise to keep your document confidential and won’t use it for any other purpose, you also can remove the confidential data of your document, just make sure the modified file can reproduce your issue, and then send it to us via email ([email protected]). Thanks in advance.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF

cron