{"id":516,"date":"2012-05-24T06:28:16","date_gmt":"2012-05-24T06:28:16","guid":{"rendered":"http:\/\/www.thestupidbox.com\/blog\/?p=516"},"modified":"2021-06-25T04:08:47","modified_gmt":"2021-06-25T04:08:47","slug":"wkhtmltopdf-inconsistent-conversion","status":"publish","type":"post","link":"http:\/\/thestupidbox.com\/blog\/wkhtmltopdf-inconsistent-conversion\/","title":{"rendered":"wkhtmltopdf &#8211; inconsistent conversion"},"content":{"rendered":"<p>For the past 2-3 days, i stuck with <a title=\"Google Code\" href=\"http:\/\/code.google.com\/p\/wkhtmltopdf\/\" target=\"_blank\" rel=\"noopener\">wkhtmltopdf <\/a>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.<\/p>\n<p>The development server is &#8220;Windows Server 2008 R2&#8221;. The production server is &#8220;Windows Server 2003&#8221; \ud83d\ude42<\/p>\n<p>hahaha Wait a minute! We will upgrade our production soon.<\/p>\n<p>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<\/p>\n<ol>\n<li>give some pause for the process to complete<\/li>\n<li>thinking some image references is the problem, replaced absolute path with relative path<\/li>\n<\/ol>\n<p>Nothing helped. It was really frustrating. My colleague <a href=\"http:\/\/blog.vijay.name\" target=\"_blank\" rel=\"noopener\">Vijay<\/a>\u00a0asked to check if any command line option will help.<\/p>\n<p>I tried the &#8220;-q&#8221; global option in the wkhtmltopdf tool and it worked perfectly everywhere. Don&#8217;t know the actual cause of this problem yet. Hope this helps someone.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Update: still not working consistently. planning to upgrade the server to Windows Server 2008 R2, before MS releases Windows Server 2012.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[144,146,147,145],"class_list":["post-516","post","type-post","status-publish","format-standard","hentry","category-technical","tag-wkhtmltopdf","tag-wkhtmltopdf-inconsistent","tag-wkhtmltopdf-random","tag-wkhtmltopdf-windows-server-2003"],"_links":{"self":[{"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/posts\/516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/comments?post=516"}],"version-history":[{"count":6,"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/posts\/516\/revisions"}],"predecessor-version":[{"id":735,"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/posts\/516\/revisions\/735"}],"wp:attachment":[{"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/media?parent=516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/categories?post=516"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/thestupidbox.com\/blog\/wp-json\/wp\/v2\/tags?post=516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}