SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // --------------------------------------------------------- // set font $pdf->SetFont('dejavusans', '', 10); // custom $pdf->SetMargins(15, 15, 15); $pdf->setPrintHeader(false); $pdf->setHeaderMargin(0); $pdf->setPrintFooter(false); $pdf->setFooterMargin(0); // $pdf->setAutoPageBreak(false, 1); // add a page $pdf->AddPage(); // create some HTML content sfLoader::loadHelpers('Partial'); $html = get_partial($partial, array('datas' => $datas)); // output the HTML content $pdf->writeHTML($html, true, false, true, false, ''); // reset pointer to the last page $pdf->lastPage(); // --------------------------------------------------------- // Close and output PDF document $pdf->Output($file_path, 'F'); // ============================================================+ // END OF FILE // ============================================================+ return $file_path; } } ?>