-
Notifications
You must be signed in to change notification settings - Fork 238
Closed
Description
hi ,
I've set up the whole environment needed to generate pdf from html resources ,
but when I test the code I find that it works fine with the function saveAs(); and I can find the pdf file and open it successfully ,
but when I use the function send(); it opens the browser as it will show the pdf file but then an error message shows up and says : Failed to load PDF document.
here is the code I'm using
<?php
require 'vendor/autoload.php';
use mikehaertl\wkhtmlto\Pdf;
$pdf = new Pdf(array(
'binary' => 'wkhtmltopdf',
'ignoreWarnings' => true,
'commandOptions' => array(
'useExec' => true, // Can help if generation fails without a useful error message
'procEnv' => array(
// Check the output of 'locale' on your system to find supported languages
'LANG' => 'en_US.utf-8',
),
),
));
$pdf->addPage('test.html'); // a .html file in the root of the site
$pdf->send();
?>
no matter what the array attributes are , it doesn't work even I use
$pdf = new Pdf;
$pdf->addPage('test.html');
I really need help in this as the previous developers used mPDF library but it fails in generating more than 500 records ,, so I've decided to use mkhtmltopdf
Metadata
Metadata
Assignees
Labels
No labels