本文整理汇总了PHP中mPDF::WriteHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP mPDF::WriteHtml方法的具体用法?PHP mPDF::WriteHtml怎么用?PHP mPDF::WriteHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mPDF
的用法示例。
在下文中一共展示了mPDF::WriteHtml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mPDF
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</tr>
</tbody>
</table>
<div class="row" style="text-align: right;">
<label id="hStory" style="text-align: right">สอบถามรายละเอียดเพิ่มเติมได้ที่ 40147 (ชลวภรณ์)</label>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
$html = ob_get_contents();
ob_end_clean();
$stylesheet = file_get_contents('assets/css/print.css');
// external css
$pdf = new mPDF('th', 'A4', '0', 'thsarabunnew', 20, 15, 5, 30);
$pdf->SetAutoFont(AUTOFONT_THAIVIET);
$pdf->SetDisplayMode('fullpage');
$pdf->WriteHTML($stylesheet, 1);
$pdf->WriteHtml($html, 2);
$pdf->Output();
示例2: header
if (isset($_SESSION["last_activity"]) && $_SESSION["last_activity"] + $_SESSION["time_out"] * 60 < time()) {
session_unset();
session_destroy();
header("Location: login.php");
exit;
}
$_SESSION["last_activity"] = time();
if (isset($_POST["expected_sales"])) {
VariablesTable::update_expected_sales($_POST["expected_sales"]);
}
if (isset($_POST["table_data"])) {
$mpdf = new mPDF("", "A4", 0, 'roboto', 0, 0, 0, 0, 0, 0);
$stylesheet = file_get_contents("styles.css");
$mpdf->useSubstitutions = false;
$mpdf->simpleTables = true;
$mpdf->WriteHtml($stylesheet, 1);
$mpdf->WriteHtml($_POST["table_data"], 2);
$mpdf->Output($_POST["table_name"] . " - " . $_POST["table_date"] . ".pdf", "D");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Print Preview</title>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="toolbar_print">