您的位置:首页 > 理论基础 > 计算机网络

tcpdf用法

2016-02-18 00:00 656 查看
require\_once('./tcpdf/config/lang/eng.php');
require\_once('./tcpdf/tcpdf.php');

function htmlToPdf($html){
require\_once('extends/tools/tcpdf/config/lang/eng.php');
require\_once('extends/tools/tcpdf/tcpdf.php');

$pdf = new TCPDF(PDF\_PAGE\_ORIENTATION, PDF\_UNIT, PDF\_PAGE\_FORMAT, true, 'UTF-8', false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetDefaultMonospacedFont(PDF\_FONT\_MONOSPACED);
$pdf->SetMargins(PDF\_MARGIN\_LEFT, 10, PDF\_MARGIN\_RIGHT);
$pdf->SetAutoPageBreak(TRUE, PDF\_MARGIN\_BOTTOM);
$pdf->setImageScale(PDF\_IMAGE\_SCALE\_RATIO);
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
$pdf->AddPage();
$pdf->writeHTML($html, true, false, true, false, '');
// ---------------------------------------------------------
ob\_clean();
$pdf->Output('pdfName.pdf', 'I');
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: