<?php
tcpdf();
$obj_pdf = new TCPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$obj_pdf->SetCreator(PDF_CREATOR);
 
$obj_pdf->SetTitle("");
$obj_pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, "", PDF_HEADER_STRING);
$obj_pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$obj_pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$obj_pdf->SetDefaultMonospacedFont('helvetica');
$obj_pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$obj_pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$obj_pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$obj_pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$obj_pdf->SetFont('helvetica', '', 9);
$obj_pdf->setFontSubsetting(false);
$obj_pdf->AddPage();
//ob_start();
    // we can have any view part here like HTML, PHP etc
 
$html=''.$header.'
<table cellspacing="0" cellpadding="1" border="1" style="width:400px"> 
    <tr><td colspan="2"><h1>FAKTUR PEMBELIAN</H1></td></tr>
    <tr><td width="90">Nomor</td><td width="310">'.$purchase_order_number.'</td></tr>
     <tr><td>Tanggal</td><td>'.$po_date.'</td></tr>
     <tr><td>Supplier</td><td>'.$supplier_info.'</td></tr>
     <tr><td>Termin</td><td>'.$terms.'</td></tr>
     <tr><td>Jumlah</td><td>'.$amount.'</td></tr>
     <tr><td colspan="2">'.$lineitems.'</td></tr>
</table>';	
//$content = ob_get_contents();
//ob_end_clean();
$obj_pdf->writeHTML($html, true, false, true, false, '');
$obj_pdf->Output('output.pdf', 'I');
?>
