Menu

#64 Support PDF generators other than dompdf

open
5
2012-01-06
2011-08-24
No

Generating PDFs from ReqHeap on our server was excruciatingly slow when it worked at all, until I found a way to substitute wkhtmltopdf in place of dompdf, which wasn't trivial. I set the "PDF_SCRIPT_URL" parameter to point to a "wkhtmltopdf" subdirectory :

$ find wkhtmltopdf -name .svn -prune -o -print
wkhtmltopdf
wkhtmltopdf/include
wkhtmltopdf/include/wkpdf.cls.php
wkhtmltopdf/include/functions.inc.php
wkhtmltopdf/tmp
wkhtmltopdf/wkhtmltopdf-i386
wkhtmltopdf/dompdf.php
wkhtmltopdf/dompdf_config.inc.php
wkhtmltopdf/pdf-creator.php

The wkhtmltopdf-i386 file is the executable which does the actual PDF generation. The rest of the files are included in the attached tar file.

Discussion

  • David N. Jafferian

     
  • M. Günter

    M. Günter - 2011-09-12
    • assigned_to: nobody --> slavpeev
     
  • M. Günter

    M. Günter - 2011-09-12

    Hi Slav
    Could you add this as a different option/test in? As it is an external solution, we should add it only optionally:
    * necessary settings and check, if it exists.
    * notes in the installation and user guide

    The current engine should still be there. wkhtmltopdf can only be used in intranets.

     
  • Slav Peev

    Slav Peev - 2011-11-07

    Thanks David,
    Wkhtmltopdf is added as an additional possibility, The installation of it can't be carried on by ReqHeap, so users should take care of installing it and then to set the correct paths (Windows/Linux) in ini/params.php. If there is no path for Wkhtmltopdf , the old script will run by default.
    A notice on that is added in install.txt file also.
    Last changes can be found in SVN.

     
  • Slav Peev

    Slav Peev - 2011-11-07
    • assigned_to: slavpeev --> mguenter
     
  • Slav Peev

    Slav Peev - 2011-11-10
    • assigned_to: mguenter --> hues87
     
  • M. Günter

    M. Günter - 2012-01-05
    • assigned_to: hues87 --> slavpeev
     
  • M. Günter

    M. Günter - 2012-01-05

    Hi Slav
    Can you point out, what needs to be installed and how?
    I guess all the other files are created in the installer and are part of the head in SVN?
    wkhtmltopdf
    wkhtmltopdf/include
    wkhtmltopdf/include/wkpdf.cls.php
    wkhtmltopdf/include/functions.inc.php
    wkhtmltopdf/tmp

    wkhtmltopdf/dompdf.php
    wkhtmltopdf/dompdf_config.inc.php
    wkhtmltopdf/pdf-creator.php

     
  • Slav Peev

    Slav Peev - 2012-01-06
    • assigned_to: slavpeev --> mguenter
     
  • Slav Peev

    Slav Peev - 2012-01-06

    wkhtmltopdf library should be downloaded from here:
    http://code.google.com/p/wkhtmltopdf/downloads/list

    Depending on Windows or Linux, please choose ether
    wkhtmltopdf-0.9.9-installer.exe
    or wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2

    On windows, please install it and then set the exe file in the system path.
    Then set the path ($PATH_TO_WKHTMLTOPDF) in ini/params.php file
    for ex. $PATH_TO_WKHTMLTOPDF = "wkhtmltopdf.exe";//Windows

    On linux servers it is depending on server settings. Try to copy/paste wkhtmltopdf-amd64 into your server's root
    and then set the path ($PATH_TO_WKHTMLTOPDF) in ini/params.php file.
    If not working - a system administrator should install it and give the right permissions and then again the path to wkhtmltopdf-amd64 should be set in ini/params.php file.
    for ex. $PATH_TO_WKHTMLTOPDF = "/home/wkhtmltopdf-amd64";//Linux

    Everything else is set in RH and avalaible in the SVN.