Error in pdf generation

(10 posts) (2 voices)

Tags:

No tags yet.

  1. chadwickhung, Member

    I've migrated my server to AWS linux 2 and re-installed wkhtmltopdf. But when I run pdf in mydbr, it gave me error and error.log as below. (I've no problem running wkhtmltopdf in command line directly in linux console) Please kindly help

    Thanks a lot.

    [Tue Aug 18 03:03:18.830837 2020] [php7:error] [pid 3603] [client 99.228.141.151:53050] PHP Fatal error: Uncaught PHPExcel_Writer_Exception: PDF Rendering library has not been defined. in /var/www/vhosts/dreamware.com.hk/httpdocs/ischool/DBR/lib/external/phpExcel/PHPExcel/Writer/PDF.php:56\nStack trace:\n#0 /var/www/vhosts/dreamware.com.hk/httpdocs/ischool/DBR/lib/external/phpExcel/PHPExcel/IOFactory.php(141): PHPExcel_Writer_PDF->__construct(Object(PHPExcel))\n#1 /var/www/vhosts/dreamware.com.hk/httpdocs/ischool/DBR/lib/export.php(3568): PHPExcel_IOFactory::createWriter(Object(PHPExcel), 'PDF')\n#2 /var/www/vhosts/dreamware.com.hk/httpdocs/ischool/DBR/lib/export.php(3741): mydbrExport->output_excel()\n#3 /var/www/vhosts/dreamware.com.hk/httpdocs/ischool/DBR/apps/showReport.php(8765): mydbrExport->print_report('pdf')\n#4 /var/www/vhosts/dreamware.com.hk/httpdocs/ischool/DBR/report.php(473): unknown()\n#5 {main}\n thrown in /var/www/vhosts/dreamware.com.hk/httpdocs/ischool/DBR/lib/external/phpExcel/PHPExcel/Writer/PDF.php on line 56, referer: http://18.162.199.109/ischool/DBR/report.php?r=114&m=8&h=2e8fbc4458f2ecb083bed69b3b1bad470a798bca&export=pdf&i=1

  2. myDBR Team, Key Master

    That would indicate that the wkhtmltopdf is not recognized correctly. You can check the "Environment settings" → "Modules" and troubleshoot it with tools/troubleshoot/wkhtmltopdf.php.

    If it is not in PHP's path, you can set the path to wkhtmltopdf-binary in user/defaults.php:

    $mydbr_defaults['export']['wkhtmltopdf']['command'] = '/path/to/wkhtmltopdf';

    --
    myDBR Team

  3. chadwickhung, Member

    Thanks

    I can see the defaults has already been set correctly in defaults.php. And under Environment settings, it is shown as installed module.

    When I run tools/troubleshoot/wkhtmltopdf.php, it shows:

    Command to use with wkhtmltopdf: "/usr/local/bin/wkhtmltopdf"
    wkhtmltopdf 0.12.6 (with patched qt) Command return value: 0
    Version info: wkhtmltopdf 0.12.6 (with patched qt)

    Is it a version issue? I'm using php7.3 running AWS Linux 2. Please advice.

    Best regards,
    Chadwick

  4. myDBR Team, Key Master

    Looks like that for some reason the export does not recognize the existence of the wkhtmltopdf even though it is there.

    You can skip the check altogether by adding following definition to user/defaults.php:

    $mydbr_defaults['export']['wkhtmltopdf']['skip_version_check'] = array(
    'wkhtmltopdf_exists' => true,
    'wkhtmltopdf_version' => '0.12.6'
    );

    Let us know if this helps.

    --
    myDBR Team

  5. chadwickhung, Member

    Thanks. I tried but it gave me the same error. I also tried different version of wkhtmltopdf, can't figure out what's wrong.
    Appreciate your further suggestion.
    Thanks a lot

  6. myDBR Team, Key Master

    That is bit strange. Could you run the updater and try again. The newer build includes some debugging information that hopefully reveals what is going on with your setup.

    --
    myDBR Team

  7. chadwickhung, Member

    Thanks. I just run the myDBR updater and tried pdf export again.

    It gave me this message on the browser:
    wkhtmltopdf export should be active. You really should not see this message

    This time, nothing appeared in error log. In access log, it shows just this:

    99.228.141.151 - - [19/Aug/2020:23:30:06 +0800] "GET /ischool/DBR/report.php?r=164&u1=834&u2=2020&u3=01&u4=2020&u5=08&m=1&h=03719d3bd9072c558be2c92f85c8821b7c15cad0&export=pdf&t_tab_0_x2=0 HTTP/1.1" 200 112 "http://18.162.199.109/ischool/DBR/report.php?r=164&u1=834&u2=2020&u3=01&u4=2020&u5=08&m=1&h=03719d3bd9072c558be2c92f85c8821b7c15cad0" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36"

    Please advice where I can get more debug info?

    Thanks again
    Chadwick

  8. myDBR Team, Key Master

    Are you accessing the report through 18.162.199.109 (using a community license)? The community license does not include PDF export capability.

    --
    myDBR Team

  9. chadwickhung, Member

    I see. Yes, because I am currently migration a production server from an old one to a new one. our myDBR license is registered with our production domain. Before I reassign the domain name to the new server, I want to test out all the myDBR report are working fine in the new server. So in this case, I can only test it after assign the domain name to the new server?

    Thanks
    Chadwick

  10. myDBR Team, Key Master

    If you want to test full functionality before making the change, you can get a Trial license which has the same functionality as the Premium one.

    There is now an improved message in myDBR for this one.

    --
    myDBR Team


Reply

You must log in to post.