I have a requirement to save incoming email details in pdf format when a document library received an email. So in the EmailReceived event receiver I created the code to retrieve all the email details using the SPEmailMessage and save it into pdf format by using iTextSharp. When I try to debug, the event receiver will not get hit. If I remove all the code that are based on the iTextSharp api the event receiver will get hit.

What is the problem here, is there any other way for me to achieve the same thing using different api.


  • Please add iTextSharp to GAC Assembly
    – user44164
    Sep 23, 2015 at 13:24

4 Answers 4


SharePoint event receivers tend to be a rather stable thing and your case looks a bit unlikely. In your situation, the first thing I would check is that the iTextSharp library is deployed to GAC properly and works at all from an Application Page or from a Webpart.

And I would check the logs, too.

Anyway, there are plenty of PDF libraries out there. Thus if you suspect that the issue relates to iTextSharp, I'd recommend you to try one of the following libraries:

You could use some very basic, "Hello world"-like example code and see if the receiver will get hit.

P.S. Please, don't forget to let us know the results of your investigations! The PDF generation topic is very interesting for me :)

  • I added the dll to the solution package and now it is working. Thanks for the detail answers Mar 9, 2012 at 10:53

You might need to add the iTextSharp as a trusted assembly in the web.config.


Note that I also added the iTextSharp.dll to the project and added it as an additional assembly to the package by double clicking the Package.package element and then, in the package designer, click Advanced to add additional assemblies:


Find where is your gacutil located and install the library.

In the command prompt execute "C:....\gacutil - i C:....\Pdf-Sharp.dll"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.