KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Export PDF + chromeBinary + Laravel = prints empty page #1439

Open Locness Tecnologia e Inovação opened this topic on on May 13, 2020 - 1 comments

Locness Tecnologia e Inovação commented on May 13, 2020

This is a little different from my previous post.

In this case, I'm calling the pdf method without a node binary, which uses \daandesmedt\PHPHeadlessChrome\HeadlessChrome to generate the PDF.

I'm using Laravel as an API backend and this is being called from a method inside a controller called "report" :

` $report->pdf([

        "format"=>"A4",
        "orientation"=>"portrait",
        'chromeBinary'=>realpath(dirname(__FILE__)) . "/../../../node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome",
    ])->saveAs($file);

`

This one does export like a printed page. However, it is an empty page:

Zooming in, we can see it tried to print a HTML file from an /api/report folder (based on the URL used to access my Laravel controller)

But, obviously, that's not where it's at. KoolReports created it at the root of my server, the /public folder:

Maybe I'm missing something, but I debugged the code and didn't see an option to determine a server path to the HTML to be rendered.

Thanks, Daniel

David Winterburn commented on May 14, 2020

Hi Daniel,

The chromeBinary/nodeBinary feature with Puppeteer in the Export package has been outdated a bit since we migrated it to the CloudExport package. We intend for Export package to focus on PhantomJS. If you want to use chromeheadless please try CloudExport. We will help you if there's any problem while using it. Thanks!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None