-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcetak.php
More file actions
32 lines (27 loc) · 715 Bytes
/
cetak.php
File metadata and controls
32 lines (27 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require __DIR__.'/vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
ob_start();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo $data['no_usulan']; ?></title>
</head>
<body>
hasil cetak
</body>
</html>
<?php
$filename="cetak".".pdf";
$content = ob_get_clean();
$content = '<page style="font-family: freeserif">'.$content.'</page>';
try
{
$html2pdf = new HTML2PDF('P','F4','en', false, 'ISO-8859-15',array(10, 10, 0, 0));
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$html2pdf->Output($filename);
}
catch(HTML2PDF_exception $e) { echo $e; }
?>