private static function downloadPDF($content, $filename) { if (!is_executable(WKPDF_PATH)) { throw new \Exception('WKPDF is not installed or executable', 666); } $pdf = new \WKPDF(WKPDF_PATH); if (USE_XVFB) { $pdf->setXVFB(XVFB_PATH); } $pdf->set_html($content); $pdf->render(); $pdf->output(\WKPDF::$PDF_DOWNLOAD, '/tmp/' . $filename); exit; }