Question

I am using ExpertPDF HtmlToPdf Converter to generate PDFs with my ASMX web service. But the quality is bad and varies with the Windows Forms version on the same machine. My code for using the library is exactly the same in the two applications.

What can make the difference?

Samples:

PDF generated with the .NET web service (Windows Server 2008, ExpertPDF version 8): PDF generated with the .NET web service (Windows Server 2008, ExpertPDF version 8)

PDF generated with a Windows Forms application (Windows Server 2008, ExpertPDF version 8): PDF generated with a Windows Forms application (Windows Server 2008, ExpertPDF version 8)

Was it helpful?

Solution

The solution was in the FAQ, you have to set "Load User Profile" to TRUE in the application pool advanced settings in IIS7.

FAQ answer:

Q: After I have installed IE9 on the computer where the converter runs the generated PDF does not contain anymore searchable text.

A: First check that you didn't set PdfConverter.PdfDocumentOptions.GenerateSelectablePdf property to false by mistake. By default this property is true. If the property is true then the issue must be caused by the IE9 installation. The version 7.0 of converter (and the version 6.0 of the PDF Creator) should work well when the IE9 is installed. However, when the converter runs in IIS under an identity which doesn't have an user profile (like ApplicationPoolIdentity identity) it is possible to see this issue even if the version 7 of the converter is used. The NetworkService identity always has a profile and the converter should run well under this identity.

To resolve this issue you can either set Load User Profile on True in the pool Advanced Settings in IIS or you can press the Configure button in the IE9Config utility to get the same effect. You can find the IE9Config.exe utility in the bin folder of the installation. The IE9Config utility must be executed as Administrator. To do this you can select the executable file in Windows Explorer, right click on it and select 'Run as Administrator' from the popup menu.

Important: After you have set the Load User Profile on True or you have pressed the Configure button in the IE9Config utility you have to recycle the IIS pool or restart IIS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top