wkhtmltoimage crashing at 25%

Posted on the April 13th, 2013 under Uncategorized by Tohir

I’ve had to turn off this functionality till I could find a fix. Sometimes, it worked, sometimes it didn’t. One URL in particular I had difficult fixing was: http://www.musjidnoor.za.net/index.html

Console Results

xvfb-run –auto-servernum –server-num=1 wkhtmltoimage –disable-javascript –use-xserver -f png -n ‘http://www.musjidnoor.za.net/index.html’ /var/www/docprogress_temp/1365305896.png
Loading page (1/2)
Rendering (2/2)
^C==============> ] 25%

Thought came in my mind, maybe it’s because there page is either big or long. Let’s try cropping the height:

xvfb-run –auto-servernum –server-num=1 wkhtmltoimage –disable-javascript –use-xserver -f png –crop-h 6000 -n ‘http://www.musjidnoor.za.net/index.html’ /var/www/docprogress_temp/1365305896.png
Loading page (1/2)
Rendering (2/2)

Wallah, that seems to fix it. I gradually increase mine to 6000 which is more sufficient in my case. Suggestion, try adding –crop-h {a height}, and see if this fixes it.

Leave a Reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>