wkhtmltopdf – inconsistent conversion

For the past 2-3 days, i stuck with wkhtmltopdf tool. We have an ASP.NET application converting some html files to pdf files. It worked perfectly in dev/QA server. We are using .NET Process class to start the conversion.

The development server is “Windows Server 2008 R2”. The production server is “Windows Server 2003” 🙂

hahaha Wait a minute! We will upgrade our production soon.

Ok, the problem here with the production server is, the html to pdf conversion is not consistent. One in 8 attempts it worked. After trying the followings

  1. give some pause for the process to complete
  2. thinking some image references is the problem, replaced absolute path with relative path

Nothing helped. It was really frustrating. My colleague Vijay asked to check if any command line option will help.

I tried the “-q” global option in the wkhtmltopdf tool and it worked perfectly everywhere. Don’t know the actual cause of this problem yet. Hope this helps someone.

 

Update: still not working consistently. planning to upgrade the server to Windows Server 2008 R2, before MS releases Windows Server 2012.