Error with PDF rendering

(4 posts) (3 voices)
  • Started by John@primetimesolutions.com
  • Latest reply from myDBR Team
  1. John@primetimesolutions.com, Member

    Some of our users are having issues saving reports to PDFs. They can view the HTML version of the report, but when they click the PDF link, they'll get this error.

    There was an error (code:11) producing the pdf document
    Failed command: /usr/local/bin/wkhtmltopdf -q --header-html https://reports.ourdomain.com/user/export_header_pdf.php --margin-top 13 /tmp/805917985.html -

    I know this error would seem to be related to wkhtmltopdf but it does work for some of our users.

    I've tried running the command as root (and as a normal user) . The command printed in the error is incomplete and needs the output file as the last argument.

    If I add /tmp/foo.pdf to the end as a last argument:

    "wkhtmltopdf --header-html https://reports.ourdomain.com/user/export_header_pdf.php --margin-top 13 /tmp/805917985.html /tmp/foo2.pdf"

    This is the output I get:
    ====
    Error: Failed loading page https://reports.ourdomain.com/user/export_header_pdf.php?page=1&section=&title=Report Title Here&subsection=&frompage=1&subsubsection=&topage=1&doctitle=Report Title Here&webpage=/tmp/805917985.html&time=10:38:11&date=15 Apr 2013 (sometimes it will work just to ignore this error with --load-error-handling ignore)
    QPaintDevice: Cannot destroy paint device that is being painted
    Segmentation fault

    ===

    Here's our facts:
    ===========
    Non-working computers:

    Windows machine A: tested 2 different users neither works. Tested with IE 10.0.9200.16521 , Firefox 20.0.1 , Chrome: 26.0.1410.64 m
    * one of these users works find on a MAC, but not this windows machine

    Windows machine B: tested 1 user works fine. Tested with IE 9 , Firefox 20.0

    Mac A: tested 1 user works fine (this user doesn't work on windows machine A). Chrome 26.0.1410.65, Firefox 20.0.0
    ===
    Server Information:

    # cat /etc/redhat-release
    Red Hat Enterprise Linux Server release 5.8 (Tikanga)
    # uname -a
    Linux servername.ourdomain.com 2.6.18-348.3.1.el5 #1 SMP Tue Mar 5 13:19:32 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

    # /usr/local/bin/wkhtmltopdf --version
    Name: wkhtmltopdf 0.11.0 rc1

    # md5sum /usr/local/bin/wkhtmltopdf 89ac9d9993c3463f88204d5cee78cfad /usr/local/bin/wkhtmltopdf

    # httpd -v
    Server version: Apache/2.2.3
    Server built: Nov 19 2012 05:10:06

    # php -v
    PHP 5.4.12 (cli) (built: Feb 20 2013 14:03:27)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd.

    # openssl version
    OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

  2. myDBR Team, Key Master

    John,
    while it may seem that the execution works on some users and does not in other, the problem still lies fully on the server and most likely cause is an error in wkhtmltopdf / environment.

    The command shown in the error message is the command that myDBR executes. The final dash parameter means that the command output is put into standard output where myDBR reads it from.

    To debug the code, you can add export debug option into the report. This way myDBR generates the file to be converted and displays the wkhtmltopdf commnd that it would normally execute. You can then try out if you get more detailed error messages when the command is run from command line. The export option is:

    select 'dbr.export.options', 'debug', 1

    If there are no additional information from the debug version, you can try out older version of wkhtmltopdf as sometimes the older version works better.

    --
    myDBR Team

  3. vsivaprabu, Member

    While download the pdf getting the following error msg

    There was an error (code:134) producing the pdf document

    Could you please help me.

    Thanks & Regards,
    Sivanesan.V

  4. myDBR Team, Key Master

    Try the debug mode to see more details on the error:

    select 'dbr.export.options', 'debug', 1

    --
    myDBR Team


Reply

You must log in to post.