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) »
  • dompdf fails and wkhtmltodpf is inadequate.
Pages: [1]

Author Topic: dompdf fails and wkhtmltodpf is inadequate.  (Read 11743 times)

ldgpangeo

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 0
  • CiviCRM version: 4.2.6
  • CMS version: drupal-7.17
  • MySQL version: 5.5.23
  • PHP version: 5.3.13
dompdf fails and wkhtmltodpf is inadequate.
September 21, 2013, 06:19:48 pm
I'm running into serious problems with the pdf option in civiReports.

The default tool (dompdf) fails for longer reports -- in our case a 5 page list of all members.  This problem has been documented in other forum postings.  Dompdf appears to become a massive resource hog for anything beyond the shortest and simplest of pages.

I followed the instructions for the recommended replacement (wkhtmltopdf) but it does a terrible job with page breaks, often rendering half a line one one page and the other half on the other -- simply unacceptable in terms of usability.

Am I missing something?   Have others managed to get wkhtmltopdf to render page breaks correctly?  Is there a third option supported within CiviCRM? 


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: dompdf fails and wkhtmltodpf is inadequate.
September 21, 2013, 07:13:49 pm

sorry no third option :(

Would be great if you can investigate wkhtmltopdf and see if we can do things a bit differently to improve the integration between civicrm and wkhtmltopdf

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

krypto

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 5
  • IT guy for @bhahumanists. Running Civi on WP.
    • British Humanist Association
  • CiviCRM version: 4.5.8
  • CMS version: WordPress 4.x
  • MySQL version: 5.5.x
  • PHP version: 5.5.x
Re: dompdf fails and wkhtmltodpf is inadequate.
September 23, 2013, 11:16:17 am
Have you tried this for wkhtmltopdf page breaks?

http://stackoverflow.com/questions/8786755/wkhtmltopdf-characters-in-single-line-partially-cut-between-pages

Sounds like display:block may fix it.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: dompdf fails and wkhtmltodpf is inadequate.
September 23, 2013, 12:41:51 pm

let us know if someone experiments with this and it fixes it. Would be good to contribute a PR to add this to the html of pdf generated pages

the code for this is here:

CRM/Utils/PDF/Utils.php (search for // Glue the pages together)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • dompdf fails and wkhtmltodpf is inadequate.

This forum was archived on 2017-11-26.