-
Notifications
You must be signed in to change notification settings - Fork 0
/
print.php
108 lines (100 loc) · 2.94 KB
/
print.php
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
// Define relative path from this script to mPDF
$nama_dokumen='Data Pendaftar'; //Beri nama file PDF hasil.
define('_MPDF_PATH','mpdf/');
include(_MPDF_PATH . "mpdf.php");
$mpdf=new mPDF('utf-8', 'A4'); // Create new mPDF Document
//Beginning Buffer to save PHP variables and HTML tags
ob_start();
date_default_timezone_set('Asia/Jakarta');
$date = date('d-m-Y', time());
$mpdf->setFooter('SIPMB Universitas Islam Batik Surakarta | {PAGENO} / {nbpg} | '.$date);
$id=$_GET['id'];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="author" content="Sergey Pimenov and Metro UI CSS contributors">
<link rel='shortcut icon' type='image/x-icon' href='../favicon.ico' />
<title><?php echo $id; ?></title>
</head>
<body>
<div style="width: 359;height: 208px; background-image: url('ID_Card.png');background-position: 50% 50%; background-size: cover;">
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td width="29px" height="65px">1</td>
<td width="51px">2</td>
<td width="243px">3</td>
<td width="32px">4</td>
</tr>
<tr>
<td width="29px" height="65px"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="30px">2</td>
<td rowspan="3"></td>
<td> Purwanto</td>
<td></td>
</tr>
<tr>
<td >3</td>
<td>VII C</td>
<td></td>
</tr>
<tr>
<td>4</td>
<td></td>
<td></td>
</tr>
</table>
</div>
<br>
<div style="width: 359;height: 208px; background-image: url('ID_Card.png');background-position: 50% 50%; background-size: cover;">
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td width="29px" height="65px">1</td>
<td width="51px">2</td>
<td width="243px">3</td>
<td width="32px">4</td>
</tr>
<tr>
<td width="29px" height="65px"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="30px">2</td>
<td rowspan="3"></td>
<td> Purwanto</td>
<td></td>
</tr>
<tr>
<td >3</td>
<td>VII C</td>
<td></td>
</tr>
<tr>
<td>4</td>
<td></td>
<td></td>
</tr>
</table>
</div>
<br>
</body>
</html>
<?php
$html = ob_get_contents(); //Proses untuk mengambil hasil dari OB..
ob_end_clean();
//Here convert the encode for UTF-8, if you prefer the ISO-8859-1 just change for $mpdf->WriteHTML($html);
$mpdf->WriteHTML(utf8_encode($html));
$mpdf->setFooter('SIPMB Universitas Islam Batik Surakarta | {PAGENO} / {nbpg} | '.$date);
$mpdf->Output($nama_dokumen.".pdf" ,'I');
exit;
?>