We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Saving PDF throws error: An entry with the same key already exists

I have got the same error message when I try to save a Aspose.PDF document

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

doc.Save("c:\\output.pdf");

Hi Chris,

Thank you for writing us back.

Please note that your query is related to Aspose.Pdf. Let me forward your inquiry to the Aspose.Pdf support forum where my colleague from Aspose.Pdf support team will guide you further.

PetercwPan:

I have got the same error message when I try to save a Aspose.PDF document

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

doc.Save("c:\\output.pdf");

Hi Chris,

Thanks for using our API's.

Please share the resource PDF file, so that we can test the scenario in our environment. We are sorry for this inconvenience.
Are you debugging? If so, you need to stop VS from breaking when an exception is thrown.

Apparently, Save throws and catches exceptions internally. Go to Tools / Options / Debugging and enable Just My Code. Now, under Debug / Exceptions, uncheck Thrown and check User-unhandled. The debugger will now ignore an exception thrown and caught within the Aspose code.

This is based on running the CSharp example, from Aspose.Pdf 10.5.1.0, with no license.
Save always threw two exceptions: ArgumentException(An entry with the same key already exists.) and then Glyph with ID = 3242 already exists in the Coverage list.


Hi there,


Thanks for your feedback. I have again tested the scenario with a sample PDF document using Aspose.Pdf for .NET 11.6.0 and unable to notice the reported exception. As requested above we need the problematic PDF document for investigation as the issue seems file specific issue.

Furthermore, it is recommended to use latest version of Aspose.Pdf for .NET as it includes lot of fixes and improvements.

We are sorry for the inconvenience caused.

Best Regards,