CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • wkhtmltopdf returns error
Pages: [1]

Author Topic: wkhtmltopdf returns error  (Read 3955 times)

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
wkhtmltopdf returns error
September 23, 2014, 03:57:28 am
When I try to produce a pdf of the report civi returns with this error... what am I doing wrong?

Sorry but we are not able to provide this at the moment.
The exit status code '' says something went wrong: stderr: "" stdout: "" command: /usr/local/bin/wkhtmltopdf --lowquality --margin-bottom '0.75in' --margin-left '0.75in' --margin-right '0.75in' --margin-top '0.75in' --orientation 'landscape' --page-height '792pt' --page-width '612pt' '/tmp/knp_snappy542150e58ea1b.html' '/tmp/knp_snappy542150e58f2ae.pdf'.


I am using centos 6.5 and the RPM package downloaded from the wkhtmltopdf website.
« Last Edit: September 23, 2014, 04:00:34 am by tapash »

timatidg

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Same problem here (I think--error 11)
October 10, 2014, 01:39:37 pm
My exit status code error was "11" and I found nothing about this. I showed it getting to 10% complete before dying. I entered the entire command in the SSH command line and it processed without a problem. I'm trying to figure out if it's a path or permissions issue, but the prblem is within civi (or with permissions) and not my wkhtmltopdf install apparently.

Sorry but we are not able to provide this at the moment.
The exit status code '11' says something went wrong: stderr: "Loading pages (1/6) [> ] 0% [======> ] 10% " stdout: "" command: /home/[usernamehere]/wkhtmltopdf/usr/local/bin/wkhtmltopdf --lowquality --margin-bottom '0.75in' --margin-left '0.75in' --margin-right '0.75in' --margin-top '0.75in' --orientation 'landscape' --page-height '792pt' --page-width '612pt' '/tmp/knp_snappy543843397e6a6.html' '/tmp/knp_snappy54384339800df.pdf'.

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: wkhtmltopdf returns error
October 11, 2014, 04:23:30 am
Try logging in and executing the same command, substituting a .html file of your own. You may find that the version of wkhtmltopdf installed doesn't support some of the switches used in that command.
@xurizaemon ā— www.fuzion.co.nz

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: wkhtmltopdf returns error
January 20, 2015, 03:49:43 am
I know its a bit old thread. But still having the same issue with a different installation... any idea how to fix it?

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: wkhtmltopdf returns error
January 20, 2015, 12:19:53 pm
Two things that *might* be happening.

If you're seeing a partial output as timatidg reported above but testing the command in CLI works OK, that sounds like PHP may have stopped waiting for the wkhtmltopdf process to run before it was completed. Resolving this might involve adjusting how long your PHP executable can run for, or CiviCRM wait for external commands to complete.

If the command doesn't work in CLI, then you need to adjust the command CiviCRM is calling. At some point the parameters to wkhtmltopdf changed I think, and your CiviCRM may be giving parameters to wkhtmltopdf on the commandline which don't work. Resolving this would involve adjusting either how CiviCRM calls the command, or the version of the wkhtmltopdf program you install, so that they match.

HTH
@xurizaemon ā— www.fuzion.co.nz

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: wkhtmltopdf returns error
January 23, 2015, 02:01:36 pm
thanks Chris. I just figured out, proc_open was disabled in php.ini, and i am able to generate pdf successfully after removing that from disabled function from php config.

tapash

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.1
  • PHP version: 5.3.3
Re: wkhtmltopdf returns error
January 24, 2015, 03:17:10 am
... but now facing another issue.

 I have around 2000 contacts, I am able to generate around 300x2page letters max in 40 seconds. more than that my screen just does not do anything when process starts and remains on a blank loading screen forever.. until i get 504 gateway timeout. I have increased all the value in server to the max. but no luck.. is there any limitations on the wkhtmltopdf side? i have noticed wkhtmltopdf generated html in tmp folder does not exceed 8mb, whether i have generated a big or small number of pages. any suggestion please?
« Last Edit: January 24, 2015, 03:29:41 am by tapash »

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: wkhtmltopdf returns error
February 02, 2015, 11:11:31 am
TBH I honestly don't know much about the letter generating process, but if I had to deal with generating thousands of PDFs (which ultimately means generating thousands of CiviCRM page outputs *and* converting the output HTML to PDF), I'd probably either make it a batch process OR do it using a task on the commandline (probably via Drush since it offers a good framework for CLI, but whatever you please).

There are other approaches, but ultimately what you want to do is likely (1) sidestep the process limitations on web requests or (2) break your task into manageable bites which won't run into web request limitations.

Not sure I can help much further - could be worth talking to a professional consultant who could help you with the technical side of that, or explore ways of improving that aspect of CiviCRM through a community contribution.
@xurizaemon ā— www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • wkhtmltopdf returns error

This forum was archived on 2017-11-26.