I'm getting an error when attempting to export. Here's the error I'm getting:
Fatal error: Uncaught Exception: Could not save content to temporary folder in C:\Users\Frank\Documents\phptest\koolreport\export\Handler.php:131 Stack trace: #0 C:\Users\Frank\Documents\phptest\koolreport\export\Handler.php(238): koolreport\export\Handler->saveTempContent() #1 C:\Users\Frank\Documents\phptest\reports\approval-memo\index.php(10): koolreport\export\Handler->pdf(Array) #2 {main} thrown in C:\Users\Frank\Documents\phptest\koolreport\export\Handler.php on line 131
I'm on Windows 10 running WAMP with PHP 7.
And here's my code:
approval-memo.php
<?php
require "../../koolreport/core/autoload.php";
class ApprovalMemo extends \koolreport\KoolReport
{
use \koolreport\export\Exportable;
}
?>
approval-memo.view.php
<html>
<head>
<title>Content that you want to convert to PDF</title>
</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>
<body>
</html>
index.php
<?php
require "approval-memo.php";
$pdf = new ApprovalMemo;
$pdf->export()
->settings(array(
"useLocalTempFolder"=>true,
))
->pdf(array(
"format"=>"A4",
"orientation"=>"portrait"
))->toBrowser("approval-memo.pdf");
I've also tried removing the "useLocalTempFolder" property, but I get the same error message. I can see the .tmp files being created, but they're empty and no content is ever written to them. I've given the necessary user full permissions on the directory where the tmp files are being placed, but still have the issue. Any ideas what may be wrong?