Example #1
0
 function dispNstore_digitalCertificate()
 {
     $oNstore_digitalModel = getModel('nstore_digital');
     $logged_info = Context::get('logged_info');
     $cart_srl = Context::get('cart_srl');
     if (!Context::get('is_logged')) {
         return new Object(-1, 'msg_login_required');
     }
     $config = $oNstore_digitalModel->getModuleConfig();
     $item_info = $oNstore_digitalModel->getPurchasedItem($logged_info->member_srl, $cart_srl);
     Context::set('item_info', $item_info);
     if (!in_array($item_info->order_status, array('3'))) {
         return new Object(-1, '구매완료된 상품이 아닙니다.');
     }
     // create new PDF document
     $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('TCPDF Example 006');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     /*
     		// set default header data
     		$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING);
     */
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     //$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // remove default header/footer
     //$pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     //set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     //set auto page breaks
     //$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     //set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     //set some language-dependent strings
     $pdf->setLanguageArray($l);
     // ---------------------------------------------------------
     // set font
     //$pdf->SetFont('dejavusans', '', 10);
     $pdf->SetFont('cid0kr', '', 16);
     // table line height
     //$pdf->setCellHeightRatio(1.9);
     $pdf->setCellHeightRatio(1.7);
     // add a page
     $pdf->AddPage();
     // output the HTML content
     $this->setTemplatePath($this->module_path . "tpl");
     $oTemplate =& TemplateHandler::getInstance();
     $output = $oTemplate->compile($this->module_path . 'tpl', 'certificate');
     $pdf->writeHTML($output, true, false, true, false, '');
     // reset pointer to the last page
     $pdf->lastPage();
     //Close and output PDF document
     $pdf->Output('certificate.pdf', 'I');
     exit;
 }
Example #2
0
            </style>
        <table class="head conBorde titulo" border="1" width="100%">
            <tr><td>RELACIÓN DE DOCUMENTACIÓN SOPORTE DE LA AUTORIZACIÓN DE PAGO</td></tr>
        </table>
        <br><br><br>
        <table border="1" cellpadding="10" style="border-collapse:collapse;" width="100%">            
            <tr class="head subtitulo"><td width="20%">No. DE FOLIO</td><td width="45%">TIPO DE DOCUMENTO</td><td width="20%">IMPORTE \$</td><td width="15%">PARTIDA<br>PRESUPUESTAL</td></tr>
            {$tablaComprobantes}
        </table>           
EOD;
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->Addpage("P");
    //    $pdf->writeHTMLCell($w=0, $h=200, $x='', $y='', $contenido2, $border='L', $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);
    $pdf->writeHTML($contenido2, true, false, false, false, '');
    $pdf->setCellHeightRatio(5);
    $contenido3 = <<<EOD
            <style>
    .head{background-color: #aaa7a7; text-align:center;}
    .titulo{font-weight: bold; font-size: 12px;}
    .subtitulo{font-weight: bold;}
    .conBorde{border: black solid 1; border-collapse:collapse; }
            </style>
        <table border="1" cellpadding="10" style="border-collapse:collapse;" width="100%">            
            <tr class="head subtitulo" style="line-height: 100%;"><td width="20%">TITULAR DE LA UNIDAD<BR>EJECUTORA</td><td width="80%">DIRECCIÓN GENERAL DE INVERSIÓN<BR>(RECIBE ORIGINAL Y COPIA)</td></tr>
            <tr class="subtitulo"><td></td><td></td></tr>
        </table>           
EOD;
    $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = 250, $contenido3, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
}
ob_end_clean();
Example #3
0
		public function Footer() {
			if ($this->page != 1) {
	            // Position at 15 mm from bottom
	            $this->SetY(-15);
	            // Set font
	            $this->SetFont('times', '', 11);
	            // Page number
	          	$this->Cell(0, 0, $this->getAliasNumPage(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
	        }     
        }    
	}
	$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, 'test');
	$pdf->setStoryTitle($title[0]['title']);
	$pdf->finished($finished[0]['date']);
	$pdf->setstoryWriters($writers);
	$pdf->setHeaderFont(array('times', '', 25));
	$pdf->setFooterData(array(0,64,0), array(0,64,128));
	$pdf->setMargins(10,30,10,30);
	$pdf->AddPage();
	$pdf->AddPage();
	$text = '';
	foreach($words as $word) {
		$text .= ' ' . $word['words'];
	}
	$pdf->Text(9,35,$text,0);
	$pdf->SetFont('courier');
	$pdf->setCellHeightRatio(3);
	// $pdf->MultiCell(0, 0, 0, 0, 'L', false, 1, 10, 30, true, 2, false, true, 0, 'T', true);
	$pdf->Output('GN_' . $title[0]['title'] . '.pdf', 'I');

?>