I've recently started using KoolReport and all is working well, great job on the product. When I generate PDFs using the "Export" module, I get an OK result but when I'm using "CloudExport", the result is that bit better. However, as the cloud export uses a remote server, it introduces some latency and also, in my particular application, there will be times where the users need to work offline.
As a result, it would be great to get KoolReport working with a local Chromium installation. I see across the forum various posts on this subject but no complete guide on how to get up and running. I'm hoping somebody who has this already installed can shed some light on their setup and then this thread can serve as a guide going forward.
So far, I've followed the following steps:
- Download the Node binary from https://nodejs.org/en/download/ and move node to the root of your web application.
- This version of node comes bundled with npm so just add that the node directory to your PATH.
- From the /koolreport/export/ directory, run "npm i puppeteer" to install puppeteer - this will create a "node_modules" directory.
- From the /koolreport/export/ directory, run "composer require its404/puppeteer" - this will install an additional dependency and it will create a "vendor" directory.
That should be all the software required to get this working however I could use some assistance on what KoolReport now needs to use this setup. For example, I have the following:
$report->run()
->export($report_class.'PDF')
->pdf(array(
"format"=>"A4",
"orientation"=>"landscape",
'chromeBinary'=>'...path to chrome binary...',
'nodeBinary'=>'...path to node binary...',
))
->toBrowser($report_name.'.pdf');
I.e. the 'chromeBinary' and 'nodeBinary' seem to be required but I'm unable to find any documentation on how they should be presented. For example, if I output the command that will be run from the file /koolreport/export/vendor/its404/php-puppeteer/src/Browser.php at line:
exec($fullCommand, $output, $returnVal);
This command does not look to be valid. I'll keep at it but if any one who has successfully got this working could shed them light, it would be very much appreciated. Many thanks.