Exporting PDF Error

(12 posts) (2 voices)

Tags:

No tags yet.

  1. Aardvark, Member

    Hi,

    I'm getting the following error when exporting PDFs

    There was an error (code:1) producing the pdf document
    Failed command: /usr/bin/wkhtmltopdf -q --margin-top "20" --header-spacing "8" --header-html "https://reports.shopaardvark.com/user/export_header_pdf.php" --replace rdate "28-02-2017" --replace rtime "11:47:13 am" /tmp/mydbr_export_1211089132.html -

    Please Help

    John

  2. Aardvark, Member

    Using 4.8

  3. myDBR Team, Key Master

    Make sure your wkhtmltopdf is installed correctly. You can have more detailed error messaged with the debug-option.

    Add the option to the report:

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

    and follow the instructions and run the shown command in your command line to see more info about the error.

    --
    myDBR Team

  4. Aardvark, Member

    Hi,

    I followed your instructions and got the following output:

    root@web1:/www# /usr/bin/wkhtmltopdf -q --margin-top "20" --header-spacing "8" --header-html "https://reports.shopaardvark.com/user/export_header_pdf.php" --replace rdate "28-02-2017" --replace rtime "01:36:43 pm" /tmp/mydbr_export_2015111082.html debug_output.pdf
    The switch --header-spacing, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --replace, is not support using unpatched qt, and will be ignored.The switch --replace, is not support using unpatched qt, and will be ignored.wkhtmltopdf: cannot connect to X server

    Best Regards

    John

  5. myDBR Team, Key Master

    John,
    wkhtmltopdf is distributed with patched qt and as an unpatched one. The difference is that the patched version has more functionality. Some distros distribute the unpatched one. Uninstall the wkhtmltopdf you have and download the correct patched version from http://wkhtmltopdf.org.

    Another error you see is "wkhtmltopdf: cannot connect to X server". wkhtmltopdf requires a X server to connect to. If you are running a headless server, you can use a virtual framebuffer:

    https://www.drupal.org/node/870058

    --
    myDBR Team

  6. Aardvark, Member

    Hi,

    We think that its because https urls in the output /tmp/mydbr_export_2015111082.html

    https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3001

    Why does this have the likes of:

    <link rel="shortcut icon" href="https://reports.shopaardvark.com/images/mydbr_fav.ico?v=3231" type="image/ico">
    <link href="https://reports.shopaardvark.com/lib/external/jquery/css/jquery-ui/jquery-ui.min.css?v=3231" rel="stylesheet" type="text/css">

    Can it be re-written ideally to not include the links?

    Or do you have another solution?

    Best Regards

    John

  7. Aardvark, Member

    We are running the latest version:

    root@web1:/var/mydbr/lib# wkhtmltopdf --version
    wkhtmltopdf 0.12.4 (with patched qt)

    We do have x server installed

    Best Regards

    John

  8. myDBR Team, Key Master

    What does the

    % which wkhtmltopdf

    show you?

    The URL's to CSS files do not cause your problem.

    --
    myDBR Team

  9. Aardvark, Member

    root@web1:~# which wkhtmltopdf
    /usr/bin/wkhtmltopdf

  10. myDBR Team, Key Master

    Did you update the wkhtmltopdf between outputs?

    The error message says you are running an unpatched qt version of the wkhtmltopdf, yet your "wkhtmltopdf --version" says it has the patched one. Both run from command line. Sounds bit conflicting.

    If you re-run the export with the debug flag and re-run the command given, what is the output?

    If the problem persists, you should do a clean install of the wkhtmltopdf.

    --
    myDBR Team

  11. Aardvark, Member

    Hi,

    From my developer...

    the wkhtmltopdf was updated today from the official site to the latest version

    - if we run this

    /usr/bin/wkhtmltopdf -q --margin-top "20" --header-spacing "8" --header-html "https://reports.shopaardvark.com/user/export_header_pdf.php" --replace rdate "28-02-2017" --replace rtime "04:42:54 pm" /tmp/mydbr_export_1031754640.html debug_output.pdf
    QSslSocket: cannot resolve SSLv3_client_method
    QSslSocket: cannot resolve SSLv3_server_method
    Exit with code 1 due to network error: ContentOperationNotPermittedError

    — this is the current error

    of course the update fixed the original issue
    the current issue is the SSLv3 links
    we are complaining that they must remove https:// links from their template
    I see no way of getting this to work
    those links should not be there in the first place

    Best Regards

    John

  12. Aardvark, Member

    We have fixed it now....we were blocking it in the firewall.

    Thank you for your help!

    Best Regards

    John


Reply

You must log in to post.