Hi,
I have write a simple solution for you here:
First, create a Exporter.php
with following content:
<?php
require_once "../../../koolreport/autoload.php"; // Please change path according to your folder structure
class Exporter extends \koolreport\KoolReport
{
use \koolreport\export\Exportable;
}
function export($file,$name)
{
$exporter = new Exporter(array("file"=>$file));
$exporter->export()
->pdf(array(
"format"=>"A4",
"orientation"=>"portrait"
))
->toBrowser($name);
}
Now create its view Exporter.view.php
with following content
<?php include $this->params["file"];?>
All done!
Now how to use above code to generate content of any php or html file:
<?php
require_once "Exporter.php";
export("/path/to/mycontent.html","content.pdf");
Just simple as that, the first parameter is the path to your php/html file with any name. The second parameter is the name of pdf file.
If it confuses you, then email us to support@koolreport.com, I will send you all files.
Hope that helps