Pergunta

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.

Thanks

Foi útil?

Solução

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

Outras dicas

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"

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top