SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question
Please add iTextSharp to GAC Assembly – Deamaus Sep 23 '15 at 13:24
up vote 1 down vote accepted

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 :)

share|improve this answer
thank you very much..I'll try this and let u know.. – Agamand The True Feb 23 '12 at 9:58
I added the dll to the solution package and now it is working. Thanks for the detail answers – Agamand The True Mar 9 '12 at 10:53

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

share|improve this answer

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:

share|improve this answer

Find where is your gacutil located and install the library.

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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