本文整理汇总了PHP中mPDF::SetPageTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP mPDF::SetPageTemplate方法的具体用法?PHP mPDF::SetPageTemplate怎么用?PHP mPDF::SetPageTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mPDF
的用法示例。
在下文中一共展示了mPDF::SetPageTemplate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mPDF
<p class="project-infos">' . $sender_contact2 . '</p>
</div>
<div id="address">
<p>' . $sender_receiver . '</p>
</div>
<div id="lettertext">' . $content_content . '</div>';
$mpdf = new mPDF('', '', 0, '', 0, 0, 0, 0, 0, 0, 'P');
$mpdf->SetImportUse();
$pagecount1 = $mpdf->SetSourceFile(__PATH__ . '/templates/letter-a4-basic.pdf');
$templateID1 = $mpdf->ImportPage($pagecount1);
$mpdf->SetPageTemplate($pagecount1);
$mpdf->AddPage();
$mpdf->WriteHTML($style, 1);
$mpdf->WriteHTML($html);
$filename = time() . '_' . randomString(10) . '.pdf';
$link = __URL__ . '/cache/documents/' . $filename;
$mpdf->Output(__PATH__ . '/cache/documents/' . $filename, 'F');
if (isset($_SESSION['errors'])) {
$codes = '';
$messages = '';
foreach ($_SESSION['errors'] as $error) {
$codes .= $error['code'] . ' ';
$messages .= $error['message'] . ' ';
}
$apiResponseHeader['error'] = true;
$apiResponseHeader['code'] = $codes;
示例2: mPDF
<p class="lettertext">' . $content_text . '</p>
<p>
<br>
Mit freundlichen Grüßen<br>
<br><br>
' . $sender_name . '
</p>
</div>';
$mpdf = new mPDF('', '', 0, '', 0, 0, 0, 0, 0, 0, 'P');
$mpdf->SetImportUse();
$pagecount1 = $mpdf->SetSourceFile(__PATH__ . '/templates/letter-a4-basic.pdf');
$templateID1 = $mpdf->ImportPage($pagecount1);
$mpdf->SetPageTemplate($pagecount1);
$mpdf->AddPage();
$mpdf->WriteHTML($style, 1);
$mpdf->WriteHTML($html);
$pagecount2 = $mpdf->SetSourceFile(__PATH__ . '/templates/attachment-stellungnahme_tmg_stoererhaftung_12315.pdf');
for ($i = 1; $i <= $pagecount2; $i++) {
$templateID2 = $mpdf->ImportPage($i);
$mpdf->SetPageTemplate($templateID2);
$mpdf->AddPage();
}
$filename = time() . '_' . randomString(10) . '.pdf';
$link = __URL__ . '/cache/documents/' . $filename;
$mpdf->Output(__PATH__ . '/cache/documents/' . $filename, 'F');
if (isset($_SESSION['errors'])) {
$codes = '';
$messages = '';