Convert Multiple HTML Pages to PDF

1

I'm converting html to pdf using html2pdf . But with the increase in the number of pages this conversion takes a lot. In my case, 24 pages goes beyond 15 minutes.

Any suggestions on how to convert a large number of pages in a tolerable time? Here's an example of how I'm using it.

require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
    ob_start();
    include dirname(__FILE__).'/res/exemple00.php';
    $content = ob_get_clean();
    $html2pdf = new Html2Pdf('P', 'A4', 'fr');
    $html2pdf->setDefaultFont('Arial');
    $html2pdf->writeHTML($content);
    $html2pdf->output('exemple00.pdf');
} catch (Html2PdfException $e) {
    $html2pdf->clean();
    $formatter = new ExceptionFormatter($e);
    echo $formatter->getHtmlMessage();
}
    
asked by anonymous 17.05.2018 / 20:47

0 answers