Syncfusion.Pdf.Parsing.PdfLoadedDocument(String filename) - ArgumentException, An Item with the same key has already been added

Environment: 

Platform: WinForms .NET Framework 4.5

Versions: 

Syncfusion.Compression.Base, Version=13.4350.0.53

Syncfusion.Pdf.Base, Version=13.4350.0.53

Problem:

Hi Syncfusion Team, We are currently experiencing ArgumentException when loading pdf document using the PdfLoadedDocument. This does not happen all the time that why we are thinking of corrupted pdfs. But when we open those documents one by one using adobe there was no corruption message.

Steps that is happening before the error:

  1. We download multiple documents from a source and they are put into the file system
  2. We Load the first document using the Syncfusion.Pdf.Parsing.PdfLoadedDocument(string filename)
  3. Then we load another using another instance of pdfloadeddocument and append this document to the first document
  4. Then we save the merged document as seperate pdf
  5. on the next iteration we load the merged document
  6. and then load another pdf from the same path and append this to the merged doc
  7. The process will continue until we through all of the documents in the path.
Things that we already tried :
  • use the overload for PdfLoadedDocument ctr that accepts a boolean for OpenAndRepair - did not work
Would you able to assist us or give us some more information to help us diagnose this issue? Thank you so much! Unfortunately I will not be able to provide a pdf document but I can provide the stack trace.




2 Replies

OR Ombao, Ronald Jr. (MCCSS) September 24, 2024 08:32 PM UTC

Stack Trace

Stack Trace.JPG



IJ Irfana Jaffer Sadhik Syncfusion Team September 26, 2024 10:43 AM UTC

Hi Ombao,


After reviewing the details you've provided, we found that you are using an outdated version of our product. We recommend updating to the latest packages and trying again. We’ve attached the sample we used to replicate the issue, but we were unable to reproduce it on our end. We believe the issue could be specific to the document you're working with.


We would like to remind you that we have a Non-Disclosure Agreement (NDA) in place with our customers, ensuring the confidentiality of any shared information. Any documents provided to Syncfusion will only be used for troubleshooting and will not be disclosed to anyone else. Please create a ticket at https://support.syncfusion.com/ and share the original document or provide a version with any confidential information removed along with the modified sample to repicate the issue on our end.


Sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/BugSample_1-366322533


Best regards,

Irfana J.


Loader.
Up arrow icon