I have tried to generate a pdf using html2pdf. In my localhost, everything works fine. It loads for 3 seconds. But in my server it takes more than 30 seconds!
I have checked the memory_limit, it says 128M, changed it to 256M (php code), it has the same performance. Changing libraries isn't an option though, I tried mpdf first but it doesn't support block levels in table. Here's my code:
include_once APPPATH . 'third_party/html2pdf/html2pdf.class.php';
try
{
$html2pdf = new HTML2PDF($param["orientation"], $param["paper_size"], 'fr');
$html2pdf->setDefaultFont($param["font"]);
$html2pdf->writeHTML($param["html"], isset($_GET['vuehtml']));
$filename = $param["filename"];
if ($param["action"] == "download") {
$html2pdf->Output($filename, 'D');
} else {
$html2pdf->Output($filename);
}
} catch (HTML2PDF_exception $e) {
echo $e;
exit;
}
Do i need so setup something in my web server?
you are increasing memory limit but not time limit. As you said its taking 30 seconds or more so you have to increase time limit too.