本文整理汇总了PHP中mPDF::setHTMLFooter方法的典型用法代码示例。如果您正苦于以下问题:PHP mPDF::setHTMLFooter方法的具体用法?PHP mPDF::setHTMLFooter怎么用?PHP mPDF::setHTMLFooter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mPDF
的用法示例。
在下文中一共展示了mPDF::setHTMLFooter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$f = array('odd' => array('L' => array('content' => '{DATE Y-m-d}', 'font-size' => 8, 'font-style' => 'BI', 'font-family' => 'DejaVuSansCondensed'), 'C' => array('content' => 'Odd Footer for ToC', 'font-size' => 8, 'font-style' => '', 'font-family' => ''), 'R' => array('content' => 'My Handbook', 'font-size' => 8, 'font-style' => 'BI', 'font-family' => 'DejaVuSansCondensed'), 'line' => 1), 'even' => array('L' => array('content' => 'My Handbook', 'font-size' => 8, 'font-style' => 'BI', 'font-family' => 'DejaVuSansCondensed'), 'C' => array('content' => 'Even Footer for ToC', 'font-size' => 8, 'font-style' => '', 'font-family' => ''), 'R' => array('content' => '{DATE Y-m-d}', 'font-size' => 8, 'font-style' => 'BI', 'font-family' => 'DejaVuSansCondensed'), 'line' => 0));
//==============================================================
include "../mpdf.php";
$mpdf = new mPDF('en-GB-x', 'A4', '', '', 32, 25, 27, 25, 16, 13);
$mpdf->mirrorMargins = 1;
$mpdf->SetDisplayMode('fullpage', 'two');
// LOAD a stylesheet
$stylesheet = file_get_contents('mpdfstyleA4.css');
$mpdf->WriteHTML($stylesheet, 1);
// The parameter 1 tells that this is css/style only and no body/html/text
$mpdf->WriteHTML('<h1>mPDF</h1><h2>Table of Contents & Bookmarks</h2>', 2);
// TOC TABLE OF CONTENTS and INDEX+++++++++++++++++++++++++++++++++++++++++++++
//$mpdf->WriteHTML('<pagebreak type="E" />');
//$mpdf->WriteHTML('<TOC font="" font-size="" indent="5" resetpagenum="1" pagenumstyle="A", suppress="off" />');
$mpdf->TOCpagebreakByArray(array('tocfont' => '', 'tocfontsize' => '', 'tocindent' => '5', 'TOCusePaging' => true, 'TOCuseLinking' => '', 'toc_orientation' => '', 'toc_mgl' => '45', 'toc_mgr' => '35', 'toc_mgt' => '', 'toc_mgb' => '', 'toc_mgh' => '', 'toc_mgf' => '', 'toc_ohname' => '', 'toc_ehname' => '', 'toc_ofname' => '', 'toc_efname' => '', 'toc_ohvalue' => 0, 'toc_ehvalue' => 0, 'toc_ofvalue' => -1, 'toc_efvalue' => -1, 'toc_preHTML' => '<h2>Contents</h2>', 'toc_postHTML' => '', 'toc_bookmarkText' => 'Content list', 'resetpagenum' => '1', 'pagenumstyle' => 'A', 'suppress' => 'off', 'orientation' => '', 'mgl' => '', 'mgr' => '', 'mgt' => '', 'mgb' => '', 'mgh' => '', 'mgf' => '', 'ohname' => '', 'ehname' => '', 'ofname' => '', 'efname' => '', 'ohvalue' => 0, 'ehvalue' => 0, 'ofvalue' => 0, 'efvalue' => 0, 'toc_id' => 0, 'pagesel' => '', 'toc_pagesel' => '', 'sheetsize' => '', 'toc_sheetsize' => ''));
$mpdf->setHTMLFooter('<div align="center"><b>{PAGENO} / {nbpg}</b></div>');
$mpdf->setHTMLFooter('<div align="center"><b><i>{PAGENO} / {nbpg}</i></b></div>', 'E');
//==============================================================
for ($j = 1; $j < 7; $j++) {
if ($j == 2) {
$mpdf->WriteHTML('<pagebreak resetpagenum="0" pagenumstyle="a" />', 2);
}
if ($j == 3) {
$mpdf->WriteHTML('<pagebreak resetpagenum="1" pagenumstyle="I" />', 2);
}
if ($j == 4) {
$mpdf->WriteHTML('<pagebreak resetpagenum="0" pagenumstyle="i" />', 2);
}
if ($j == 5) {
$mpdf->WriteHTML('<pagebreak resetpagenum="0" pagenumstyle="1" />', 2);
}
示例2: date
$date = date('m-d-Y');
$sum = getTotalInvoice($company_id);
foreach ($sum as $product) {
$TotalInvoice_price = $product['grant_total'];
$Total_tax_value = TaxValue();
$Total_tax_rate = $Total_tax_value;
$TotalInvoice_total_tax = $Total_tax_rate * ($TotalInvoice_price / 100);
$TotalInvoice_net_amount = $TotalInvoice_price + $TotalInvoice_total_tax;
// echo "<pre>";
// print_r($TotalInvoice_total_tax);
// echo "</pre>";
}
// exit;
$mpdf = new mPDF('utf-8', 'A4-L', '18');
$pgThree = 'Page {PAGENO}';
$mpdf->setHTMLFooter('{PAGENO}');
$message_header = '<table align ="right" width="65%" style="border:1px solid black;">';
$message_header .= '<tr>';
$message_header .= '<td><b>Invoice Number : ' . $rand_number . '</b></td>';
$message_header .= '<td><b>' . $pgThree . '</b></td>';
$message_header .= '</tr>';
$message_header .= '<tr>';
$message_header .= '<td><b>Date : ' . $date . '</b></td>';
$message_header .= '<td><b>Terms: Net ' . $Invoice_Type . ' Days</b></td>';
$message_header .= '</tr>';
$message_header .= '</table>';
$message_header .= '<h3 style="text-align:left; width:100%;">' . $company_name . '<br>' . $comp_bussiness_add_1 . '<br>' . $comp_bussiness_add_2 . '<br>' . $company_city . "," . $company_state . " " . $company_zip;
'</h3>';
$message_header .= '<table>';
$message_header .= '<tr>';
$message_header .= '<th align="center" style="padding-left:5%;font-size:14px; width: 25%;"> JobNumber </th>';
示例3: nitro_render_pdf
protected function nitro_render_pdf($quizid, $userid, $cm)
{
global $CFG, $DB, $PAGE, $OUTPUT, $USER, $SESSION, $CM;
$PAGE->requires->jquery();
//disable SUBMIT button after click on this button
echo '<script>document.getElementById("nitro_submit").disabled=true;</script>';
//define where is storage WIRIS image
$WIRIS_URL_IMAGE_SERVICE = $CFG->wwwroot . '/question/type/wq/quizzes/service.php?service=cache&name=';
//GENERATE HTML FILE? DEFAULT IS FALSE
$generate_html_file = true;
$html_contents = '';
//numbers of parts of the report
$PROGRESSBAR_PARTS = 9;
//get information about quiz, if quiz info is empty - quiz doesn't exists
$info_quiz = $this->nitro_get_quiz($quizid);
$this->SetBarWidth(0);
@ob_flush();
@flush();
//context
$context = context_module::instance($cm->id);
$contexts_array = explode('/', $context->path);
unset($contexts_array[0], $contexts_array[1]);
arsort($contexts_array);
$contexts_array_tmp = '';
foreach ($contexts_array as $id => $val) {
$contexts_array_tmp .= '"' . $val . '",';
}
$contexts_array = substr($contexts_array_tmp, 0, -1);
//context end
//mode note - 1 - error in all answer, 2 - error half answer
$MODE_NOTE = 2;
if (isset($_POST['evaluation_nopart']) && $_POST['evaluation_nopart'] == 1) {
$MODE_NOTE = 1;
}
// generate_excel_files
$GENERATE_EXCEL = false;
if (isset($_POST['generate_excel_files']) && $_POST['generate_excel_files'] == 1) {
$GENERATE_EXCEL = true;
}
//if info quiz is empty, show error
if (empty($info_quiz)) {
print_error('quizdoesntexists', 'quiz_nitroreportpdf', new moodle_url('/mod/quiz/report.php?id=' . $cm->id . '&mode=nitroreportpdf'));
} else {
//get info about course
$info_course = $this->nitro_get_course($info_quiz->course);
//specifies the number of decimal places. If the quiz that did not specify, the default is the number 4
$decimalpoints = $info_quiz->decimalpoints >= 0 ? $info_quiz->decimalpoints : 4;
$questiondecimalpoints = $info_quiz->questiondecimalpoints >= 0 ? $info_quiz->questiondecimalpoints : 2;
/*
quiz array. Specify correct questions & answers.
*/
$tab_quiz = array();
if ($GENERATE_EXCEL) {
$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCategory("Statistic Report for Moodle Quiz")->setCompany("Jarosław Maciejewski")->setCreator("Moodle - Quiz Nitro Report PDF module")->setLastModifiedBy("Moodle - Quiz Nitro Report PDF module")->setTitle("Short statistic of test from Moodle")->setSubject("Short statistic of test from Moodle")->setDescription("Show statistic report from Moodle Quiz")->setKeywords("quiz; report; pdf; statistic;");
}
//GENERATE PDF
$mpdf = new mPDF('times');
$mpdf->useAdobeCJK = true;
$stylesheet = file_get_contents($CFG->dirroot . '/mod/quiz/report/nitroreportpdf/style.css');
$mpdf->WriteHTML($stylesheet, 1);
$mpdf->setKeywords('egzamin,moodle,jaroslaw,maciejewski');
$mpdf->setSubject(get_string('exams_on_moodle', 'quiz_nitroreportpdf'));
$mpdf->setCreator(get_string('moodle', 'quiz_nitroreportpdf'));
$mpdf->setAuthor('Jarosław Maciejewski');
$mpdf->SetProtection(array('print', 'print-highres'));
$mpdf->setTitle(get_string('exam_result', 'quiz_nitroreportpdf'));
// PDF HEADER
$mpdf->setHTMLHeader('<span style="font-size: 10pt;">' . get_string('protocol_exam', 'quiz_nitroreportpdf') . ': ' . $info_quiz->name . ' ' . get_string('of_course', 'quiz_nitroreportpdf') . ' ' . $info_course->fullname . '</span><hr />');
// PDF FOOTER
$mpdf->setHTMLFooter('<hr />
<table width="100%" border="0">
<tr>
<td style="font-size: 10pt;text-align: center;">' . get_string('page', 'quiz_nitroreportpdf') . ' {PAGENO}/{nb}</td>
<td style="font-size: 10pt;text-align: right;width: 20%;">{DATE d.m.Y H:i}</td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td style="font-size: 8pt;text-align: center;">' . get_string('gen_npdf', 'quiz_nitroreportpdf') . '</td>
</tr>
</table>');
$mpdf->setAutoTopMargin = 'pad';
$mpdf->setAutoBottomMargin = 'pad';
//GENERATOR MESSAGE AND PROGRESSBAR
?>
<link rel="stylesheet" href="<?php
echo $CFG->wwwroot . '/mod/quiz/report/nitroreportpdf/css.css';
?>
" />
<div id="nitroreportpdf_text" style="margin-left: auto; margin-right: auto;text-align: center;">
<br /><br /><br /><br /><b><?php
echo get_string('gen_pleasewait', 'quiz_nitroreportpdf');
?>
</b></div><br />
<div id="nitroreportpdf_progress" class="nitroreportpdf_graph" style=" margin-left: auto ; margin-right: auto;">
<div id="nitroreportpdf_bar" style="width:0%">
<span id="nitroreportpdf_bar_text">0%</span>
</div>
</div>
//.........这里部分代码省略.........