支付宝赞助帐号:service@kuitao8.com 

mpdf自动分页加页码的方法

Created2015-06-13   Views 6632    Author 懒人程序
<?php


$mpdf=new mPDF();
$mpdf->WriteHTML('Your Introduction');
$mpdf->AddPage();
$mpdf->WriteHTML('Your Book text');

?>

例子二 #2 - 

<?php

$mpdf=new mPDF();
$mpdf->useOddEven = 1;
$mpdf->AddPage('','','1','i','on');
$mpdf->WriteHTML('Your Book text');

?>

例子三

<?php

$mpdf=new mPDF();
$mpdf->WriteHTML('Your Introduction');
$mpdf->AddPage('L','','','','',50,50,50,50,10,10);
$mpdf->WriteHTML('Your Book text');

?>

例子4

<?php

$mpdf=new mPDF();
$mpdf->useOddEven = 1;

$mpdf->defHeaderByName('myHeader', array (
    'L' => array (),
    'R' => array (),
    'C' => array ('content' => 'Chapter 2', 'font-style' => 'B', 'font-family' => 'serif'),
    'line' => 1,
    ));

$mpdf->defHTMLHeaderByName('myHeader2','<div style="text-align: center; font-weight: bold;">Chapter 2</div>');

$mpdf->WriteHTML('Your Introduction');

// Selects new headers for ODD and EVEN pages to use from the new page onwards
// Note the html_ prefix before the named HTML header
$mpdf->AddPage('','NEXT-ODD','','','','','','','','','', 'myHeader', 'html_myHeader2', '', '', 1, 1, 0, 0);

$mpdf->WriteHTML('Your Book text');

// Turns all headers/footers off from new page onwards
$mpdf->AddPage('','NEXT-ODD','','','','','','','','','','','','','',-1,-1,-1,-1);

$mpdf->WriteHTML('End section of book with no headers');

?>

上一篇: php mpdf6.0中文乱码的解决方法
下一篇: yii2 phpexcel的调用
支持键盘 ← →

邮件订阅

订阅我们的精彩内容