本文整理汇总了PHP中mPDF::AddPageByArray方法的典型用法代码示例。如果您正苦于以下问题:PHP mPDF::AddPageByArray方法的具体用法?PHP mPDF::AddPageByArray怎么用?PHP mPDF::AddPageByArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mPDF
的用法示例。
在下文中一共展示了mPDF::AddPageByArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
<?php
include "../mpdf.php";
$html_data = file_get_contents("body.html");
$html = substr($html_data, 12, strlen($html_data) - 27);
$style_data = file_get_contents("style_with_page_2.css");
$frontmatter_data = file_get_contents("frontmatter_with_page_2.html");
$mpdf = new mPDF();
// Make it DOUBLE SIDED document
$mpdf->mirrorMargins = 1;
$mpdf->bleedMargin = 4;
$mpdf->h2toc = array();
$mpdf->WriteHTML($style_data, 1);
// UNCOMMENT THIS AND PAGE NUMBERS ARE GONE
$mpdf->AddPageByArray(array('suppress' => 'off'));
$html = "<sethtmlpagefooter name=\"footer-left\" page=\"E\" value=\"on\" />" . $html;
$html = "<sethtmlpagefooter name=\"footer-right\" page=\"O\" value=\"on\" />" . $html;
$mpdf->WriteHTML($frontmatter_data, 2);
$mpdf->WriteHTML($html, 2);
$mpdf->SetTitle("Title");
$mpdf->SetAuthor("Author");
$mpdf->SetCreator("Booktype");
$mpdf->Output();
?>
示例2: pdf
/**
* вызов ПДФ
* @param array $pages
*/
protected function pdf($pages)
{
require_once '../extensions/mpdf60/mpdf.php';
$pdf = new \mPDF('', $pages[0]['format'], 0, '', 5, 5, 8, 5);
$css = file_get_contents('../web/css/print.css');
$pdf->writeHtml("<style>{$css}</style>");
foreach ($pages as $i => $page) {
if ($pdf->y > 13) {
$pdf->AddPageByArray(['newformat' => $page['format']]);
//A4-P
}
$pdf->writeHtml($page['html']);
}
$pdf->Output("output.pdf", "I");
}