Hello, I've been struggling to get a working example of simply using exporter for basic html to pdf. I've managed to get past several of the hangups but now i'm stuck with an error: Could not save content to temporary folder.
- Can you help me figure out how to get past this error?
- Can you post a full working example of using Laravel and export for just basic html to pdf? (no reports)
Here are some code snippits:
//ReportsController.php <?php
namespace App\Http\Controllers;
use \App\Reports\MyReport;
class ReportsController extends Controller {
public function __contruct()
{
$this->middleware("guest");
}
public function index()
{
$myreport = new MyReport;
$myreport->export("App/Reports/MyReport.view.php")->settings(array("useLocalTempFolder"=>true,))->pdf(array("format"=>"A4","orientation"=>"portrait"))->toBrowser("MyReport.pdf");
}
}
//MyReport.php <?php namespace App\Reports;
//require "../koolreport/autoload.php";
class MyReport extends \koolreport\KoolReport {
use \koolreport\export\Exportable;
}
//MyReport.view.php <!DOCTYPE html> <html>
<head>
<title>Content that you want to convert to PDF</title>
<meta charset="utf-8"/>
</head>
<body>
<!-- CSS Style -->
<style>
p {font-size:20px;}
h1 {color:red}
</style>
<!-- Normal HTML content -->
<h1>Export HTML to PDF</h1>
<p>It is easy to convert HTML to PDF using KoolReport's Export package</p>
<p id="extra"></p>
<!-- Javascript embedded -->
<script type="text/javascript">
document.getElementById("extra").innerHTML = "Javascript is working";
</script>
<body>
</html>
I was able to run a standard KoolReport example report, so I know that KoolReport is working in my Laravel env. I am using the laravel package as well.
Also this is a Windows based Azure Web App...
Thanks, Brandon