Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- session_start();
- include_once("config.php"); //buat koneksi ke database
- $kode = $_GET['kode']; //kode berita yang akan dikonvert
- $query = mysql_query("SELECT * FROM SISWA WHERE NIS='".$kode."'");
- $data = mysql_fetch_array($query);
- ob_get_clean();
- $content = "<html xmlns=\http://www.w3.org/1999/xhtml\"> <!-- Bagian halaman HTML yang akan konvert --> ".
- "<head>".
- "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />".
- // ...
- "( Anggun Patriana )</p>".
- "</body>".
- "</html>";
- $filename="mhs-".$kode.".pdf";
- $content = ob_get_clean();
- $content = '<page style="font-family: freeserif">'.nl2br($content).'</page>';
- require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php');
- try
- {
- $html2pdf = new HTML2PDF('P','A4','en', false, 'ISO-8859-15',array(30, 0, 20, 0));
- $html2pdf->setDefaultFont('Arial');
- $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
- $html2pdf->Output($filename);
- }
- catch(HTML2PDF_exception $e) { echo $e; }
- ob_get_clean();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement