Example #1
0
 function loadPage()
 {
     // create new PDF document
     $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     $pdf->titulo = $this->getPlan();
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Red de Universidades Anahuac');
     $pdf->SetTitle('Plan Estrategico');
     $pdf->SetSubject($this->getPlan());
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, 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));
     // 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('helvetica', 'N', 11);
     // add a page
     $pdf->AddPage();
     $pdf->SetY(5);
     $html = "\n<!-- EXAMPLE OF CSS STYLE -->\n<style>  \n\ttd{\n\tborder:1px solid #666;\n\t}\n\t\n\ttd.title{\n\tbackground:#E5E5E5;\n\tpadding:10px;\n\t}\n   \n</style> <br />";
     $html .= $this->Model->getLineas();
     // output the HTML content
     $pdf->writeHTML($html, true, false, true, false, '');
     //Close and output PDF document
     $pdf->Output('plan_operativo.pdf', 'I');
 }
Example #2
0
$pdf->SetSubject('Primera Factura');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set margins
$pdf->SetMargins(15, 20, 15);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// borra la linea de arriba en el area del header
$pdf->setPrintHeader(false);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set some language-dependent strings (optional)
if (@file_exists('/includes/tcpdf/examples/lang/spa.php')) {
    require_once '/includes/tcpdf/examples/lang/spa.php';
    $pdf->setLanguageArray($l);
}
$pdf->SetFont('helvetica', 'B', 11);
$nit = $invoice->account_nit;
$nfac = $invoice->invoice_number;
$nauto = $invoice->number_autho;
$sfc = $invoice->sfc;
// add a page
$pdf->AddPage('P', 'LETTER');
//contenido del recuadro
$html = '
	<table border="0" width="160">
	<tr>
		<td style="font-size:8px">NIT:</td>
		<td align="left" style="font-size:10px">: ' . $nit . '</td>
	</tr>
	<tr>
		<td style="font-size:8px">FACTURA N&ordm;</td>
function pdfGen($group_name, $mode = NULL, $start_date, $end_date, $stats, $l, $title, $path_www)
{
    global $centreon_path;
    // 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 Reports Module");
    $pdf->SetAuthor(getGeneralOptInfo("pdfreports_report_author"));
    //$pdf->SetAuthor('Fully Automated Nagios');
    $pdfTitle = $title . " " . $group_name;
    //$pdfTitle = "Rapport de supervision du hostgroup ".$group_name;
    $pdf->SetTitle($pdfTitle);
    //$pdf->SetSubject('TCPDF Tutorial');
    //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // define default header data
    $header = $title . " " . $group_name;
    //$header = "Rapport de supervision du hostgroup ".$group_name;
    //$ip = $_SERVER['HOSTNAME'];
    $startDate = date("d/m/Y", $start_date);
    $time = time();
    $endDate = date("d/m/Y", $time);
    $string = _("From") . " " . strftime("%A", $start_date) . " " . $startDate . " " . _("to") . " " . strftime("%A", $time) . " " . $endDate . "\n";
    // set default header data
    $pdf->SetHeaderData('../../../img/headers/' . getGeneralOptInfo("pdfreports_report_header_logo"), PDF_HEADER_LOGO_WIDTH, $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));
    // 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('helvetica', '', 12);
    // add a page
    $pdf->AddPage();
    //Column titles
    $header = array('Status', 'Time', 'Total Time', 'Mean Time', 'Alert');
    // Pie chart Generation
    $piechart_img = pieGen($stats, $mode);
    //Data loading
    $data = $pdf->LoadData($stats);
    // print colored table
    //$pdf->ColoredTable($header, $data,$chart_img);
    if ($mode == "hgs") {
        // Hostgroup
        $pdf->ColoredTable($header, $data, $piechart_img, $path_www);
    } else {
        if ($mode == "sgs") {
            // Servicegroup
            $pdf->ServicesColoredTable($header, $data, $piechart_img, $path_www);
        }
    }
    // ---------------------------------------------------------
    //génération d'un nom de pdf
    $endDay = date("d", $time);
    $endYear = date("Y", $time);
    $endMonth = date("m", $time);
    $pdfDirName = getGeneralOptInfo("pdfreports_path_gen") . $endYear . $endMonth . $endDay . "/";
    $pdfFileName = $pdfDirName . $endYear . "-" . $endMonth . "-" . $endDay . "_" . $group_name . ".pdf";
    if (!is_dir($pdfDirName)) {
        mkdir($pdfDirName);
    }
    //Close and output PDF document
    $pdf->Output($pdfFileName, 'F');
    return $pdfFileName;
}
Example #4
0
{
    public function Footer()
    {
        $this->SetY(-15);
        $this->SetFont('helvetica', 'I', 8);
        $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
    }
}
$pdf = new MYPDF('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(15, 10, 15);
$pdf->setPrintHeader(false);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->AddPage();
foreach (tampilData($stmt) as $grid) {
    $pdf->SetFont('helvetica', 'B', 9);
    $pdf->setXY(15, $pdf->getY(), true);
    $pdf->Cell(0, 0, 'SLIP KOMISI SALES', 0, 2, 'C', 0, '', '');
    $pdf->SetFont('helvetica', '', 7);
    $pdf->setXY(15, $pdf->getY(), true);
    $pdf->Cell(0, 0, 'PT. LUXINDO RAYA', 0, 2, 'C', 0, '', '');
    $pdf->SetFont('helvetica', 'B', 7);
    $pdf->setXY(15, $pdf->getY(), true);
    $pdf->MultiCell(15, 7, "NIS", 0, 'L', false, 0, '', '', false, 0, false, false, 7, 'M');
    $pdf->MultiCell(5, 7, ":", 0, 'L', false, 0, '', '', false, 0, false, false, '', 'M');
    $pdf->MultiCell(100, 7, $grid['nis'], 0, 'L', false, 0, '', '', false, 0, false, false, '', 'M');
    $pdf->MultiCell(18, 7, "Periode", 0, 'L', false, 0, '', '', false, 0, false, false, '', 'M');
    $pdf->MultiCell(5, 7, ":", 0, 'L', false, 0, '', '', false, 0, false, false, '', 'M');
    $pdf->MultiCell(45, 7, $begin . " s.d " . $end, 0, 'L', false, 1, '', '', false, 0, false, false, '', 'M');
    $pdf->setXY(15, $pdf->getY() - 2, true);
    $pdf->MultiCell(15, 7, "Nama", 0, 'L', false, 0, '', '', false, 0, false, false, 7, 'T');
Example #5
0
$pdf->SetAuthor('Recaudacion');
$pdf->SetTitle('Programa de Servicio de Salud');
$pdf->SetSubject('Detalle programa paciente');
$pdf->SetKeywords('Paciente, PSS, Programa');
//$pdf->SetHeaderData('../../img/logo.jpg', PDF_HEADER_LOGO_WIDTH,'SERVICIO DE SALUD ARICA ','HOSPITAL REGIONAL DE ARICA Y PARINACOTA');
$pdf->setHeaderFont(array('helvetica', '', 18));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(4, 5, 5, 1);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(0);
$pdf->SetAutoPageBreak(TRUE, 0);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray($l);
$pdf->setFontSubsetting(true);
$pdf->SetFont('helvetica', '', 9, '', true);
$pdf->setPrintFooter(false);
//CREA UNA PAGINA
$pdf->AddPage('L', 'A4');
//CARGA DE CLASES Y METODOS
require_once '../../class/Tipo_Producto.class.php';
$objTipPro = new Tipo_Producto();
require_once '../../class/Nota_Credito.class.php';
$objNot = new Nota_Credito();
require_once '../../class/Conectar.class.php';
$objCon = new Conectar();
require_once '../../class/Arqueo.class.php';
$objArq = new Arqueo();
require_once '../../class/Boleta.class.php';
$objBol = new Boleta();
require_once '../../class/Pagos.class.php';
Example #6
0
         $this->AliasNbPages();
         if (!isset($this->original_lMargin)) {
             $this->original_lMargin = $this->lMargin;
         }
         if (!isset($this->original_rMargin)) {
             $this->original_rMargin = $this->rMargin;
         }
         include "modules/SalesOrder/pdf_templates/footer.php";
     }
 }
 $page_num = '1';
 // create new PDF document
 //$pdf = new PDF( 'P', 'mm', 'A4' );
 $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
 // set font
 $pdf->SetFont($default_font, " ", $default_font_size);
 $pdf->setPrintHeader(0);
 //header switched off permanently
 // auto break on
 //$pdf->SetAutoPageBreak(true);
 // set footer fonts
 //$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
 //set margins
 $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
 $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
 $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
 // set pdf information
 $pdf->SetTitle($pdf_strings['FACTURE'] . ": " . $account_name);
 $pdf->SetAuthor($owner_firstname . " " . $owner_lastname . ", " . $org_name);
 $pdf->SetSubject($account_name);
 $pdf->SetCreator('PDF Creator from www.crm-now.com');
Example #7
0
$pdf->SetTitle('Receipt');
$pdf->SetSubject('Payment');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
//$pdf->SetHeaderData(PDF_RECEIPT_LOGO, PDF_RECEIPT_LOGO_WIDTH, PDF_RECEIPT_TITLE, PDF_HEADER_STRING, array(0,0,0), array(0,0,0));
//$pdf->setHeaderFont(Array(PDF_FONT_NAME_RECEIPT, '', PDF_FONT_SIZE_RECEIPT));
//$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_INVOICE_LEFT, PDF_INVOICE_TOP, PDF_INVOICE_RIGHT);
$pdf->SetHeaderMargin(PDF_INVOICE_HEADER);
$pdf->SetFooterMargin(PDF_INVOICE_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_INVOICE_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray($l);
$pdf->SetFont('times', '', 10, '', true);
$pdf->AddPage();
$spacing = -0.01;
$stretching = 75;
$pdf->setFontStretching($stretching);
$pdf->setFontSpacing($spacing);
$titling = <<<EOD
<strong> <font style="font-size:11">Pharmacy Sys</font> </strong> <br> <strong>Official Receipt</strong><br>
Student Center Ground Floor,<br> P.O. Box Private Bag Kabarak, Kenya <br> Tel: +254 702 937 925 <br> E-mail: pharmacysys@yahoo.com 
<br>-----------------------------------------
EOD;
$header = array('Drug', 'Price.', 'Qtty', 'Cost(Kshs.)');
$ddt = <<<EOD
{$time}   
EOD;
$html = <<<EOD
Example #8
0
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// set pdf viewer preferences
$pdf->setViewerPreferences(array('Duplex' => 'DuplexFlipLongEdge'));
//Doppelseitiger Druck in einem Befehl
$pdf->SetBooklet(true, 15, 25);
// start of creating the documents
while ($meineSchueler = mysql_fetch_assoc($meineSchueler_tmp)) {
    $schueler_uid = $meineSchueler['usr_id'];
    $schueler_vorname = $meineSchueler['firstname'];
    $schueler_nachname = $meineSchueler['lastname'];
    $pdf->SetFont('times', '', 14);
    $pdf->setPrintHeader(true);
    // add a page
    $pdf->AddPage('P', 'A4');
    //personenbezogene Kopfdaten
    $pdf->SetXY(20, 42);
    $pdf->Cell(45, 5, $schueler_nachname . ', ' . $schueler_vorname, 0, 0, 'L', 0, '', 0, false, 'C', 'C');
    $pdf->Cell(0, 5, $klassenbezeichner . ': ' . $kl, 0, 1, 'R', 0, '', 0, false, 'C', 'C');
    $pdf->Line(20, 47, 195, 47, $style2);
    $pdf->SetFont('helvetica', '', 14);
    $pdf->SetY(52);
    $pdf->SetFont('helvetica', 'B', 14);
    $pdf->MultiCell(0, 2, '', 0, 'L', 0, 1, '', '', true);
    //als verticaler Abstand, mir fiel grad nichts besseres ein
    $pdf->Cell(45, 5, 'Deine Lernziele im ' . $_SESSION['aktueller_term_name'], 0, 1, 'L', 0, '', 0, false, 'C', 'C');
    $pdf->MultiCell(0, 1, '', 0, 'L', 0, 1, '', '', true);
Example #9
0
$pdf->SetHeaderMargin(0);
$pdf->SetFooterMargin(0);
// remove default footer
$pdf->setPrintFooter(false);
// 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 (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'B', 7);
// add a page
$pdf->AddPage();
//$pdf->Write(0, 'Taller industrial Servi Torno tiene el agrado de cotizarle los siguientes servicios:', '', 0, 'L', true, 0, false, false, 0);
//$pdf->SetFont('helvetica', '', 6);
///////////////////////////////////////////////////////
//////////////encabezado//////////////////
////////////////////////////////////////////////////////
$tbl = <<<EOD


<hr id="Line1" style="margin:0;padding:0;position:absolute;left:0px;top:44px;width:625px;height:1px;z-index:1;">


<div id="wb_Text1" style="position:absolute;left:380px;top:71px;width:150px;height:10px;text-align:center;z-index:2;">
Example #10
0
	$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
	
	// set image scale factor
	$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
	
	// set some language-dependent strings (optional)
	if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
		require_once(dirname(__FILE__).'/lang/eng.php');
		$pdf->setLanguageArray($l);
	}
	
	// ---------------------------------------------------------
        
	
	// set font
	$pdf->SetFont('times', 'BI', 12);
	
	// add a page
	$pdf->AddPage();
		
		//$pdf->Write(0, 'Example of HTML tables', '', 0, 'L', true, 0, false, false, 0);
		
		$pdf->SetFont('helvetica', '', 11);
		
		$htmlcode = '<table  cellpadding="6" >
						<tr>
						<td style="text-align:center;width:635px; height:344px;"><img src="'.base_url.'images/firstpage.jpg"></td>
						</tr>
						<tr><td></td></tr>
						<tr>
						<td colspan="3" style="color:#06ADB6; font-weight:bold;font-size:34px;text-align:center;width:635px;"><center>MY FUNERAL PLAN<center/></td>
Example #11
0
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
//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);
//initialize document
$pdf->AliasNbPages();
// set font
$pdf->SetFont("times", "BI", 12);
// Start Page Group
$pdf->startPageGroup();
// add a page
$pdf->AddPage();
$pdf->Cell(0, 10, "Start of group 1", 0, 1, 'L');
$pdf->AddPage();
// Start new Page Group
$pdf->startPageGroup();
$pdf->AddPage();
$pdf->Cell(0, 10, "Start of group 2", 0, 1, 'L');
$pdf->AddPage();
$pdf->AddPage();
$pdf->AddPage();
//Close and output PDF document
$pdf->Output("example_023.pdf", "I");
Example #12
0
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//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 default font subsetting mode
$pdf->setFontSubsetting(true);
// Set font
// dejavusans is a UTF-8 Unicode font, if you only need to
// print standard ASCII chars, you can use core fonts like
// helvetica or times to reduce file size.
$pdf->SetFont('dejavusans', '', 14, '', true);
// Add a page
// This method has several options, check the source code documentation for more information.
$pdf->AddPage();
// Set some content to print
$tbl_header = '<style>
table {
    border: 1px solid grey; 
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0 20px;
}
tr {
	 border-collapse: collapse;
	 border: 1px solid grey;
    padding: 3px 0;
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
//set auto page breaks
$pdf->SetAutoPageBreak(FALSE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
//$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// first page
$pdf->AddPage();
$pdf->Line(20, 20, 190, 20);
$pdf->ImageEps('../extensions/exam_organization/images/upb_logo.ai', 30, 30, 13);
$pdf->SetFont('helvetica', '', 16);
$pdf->MultiCell(80, 3, gettext("exam results"), 0, 'C', 0, 0, 75, 25);
$pdf->SetFont('helvetica', 'B', 16);
$pdf->MultiCell(130, 3, $exam_name, 0, 'C', 0, 0, 50, 33);
$pdf->MultiCell(130, 3, $date . " (" . $semester . ")", 0, 'C', 0, 0, 50, 40);
$pdf->SetFont('helvetica', '', 10);
//$pdf->MultiCell(130, 2, "Prof. Dr. Reinhard Keil", 0, 'C', 0, 0, 50, 50);
$pdf->Line(20, 60, 190, 60);
$eoDatabase = exam_organization_database::getInstance();
$eoDatabase->calculateExamResults($course);
$participants = $eoDatabase->getParticipantsForTerm($examTerm);
$notPassed = 0;
//get exam key
$examObject = exam_organization_exam_object_data::getInstance($course);
$examKey = $examObject->getExamKey($examTerm);
$maxPoints = $examObject->getExamKeyMaxPoints($examTerm);
Example #14
0
// 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));
//-----------------------------
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(15, 30, 15);
$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 font
$pdf->SetFont('helvetica', '', 9);
# creamos una página en blanco
$pdf->Addpage();
$pdf->SetFont('helvetica', '', 9);
// define barcode style
$style = array('position' => 'R', 'align' => 'C', 'stretch' => 0, 'fitwidth' => 1, 'cellfitalign' => '', 'border' => 1, 'hpadding' => '2', 'vpadding' => '2', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'Helvetica', 'fontsize' => 6, 'stretchtext' => 4);
$styleBC = array('position' => 'R', 'border' => 1, 'padding' => 2, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 255), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
$estilo_tabla = "<style>\r\n    .tablaFicha{\r\n        width: 100%;\r\n        font-size: 10px;        \r\n    }\r\n    .celdaTablaFicha{\r\n        border: 1px solid #CCCCCC;\r\n        vertical-align: middle;\r\n    }\r\n    .fecha{\r\n        text-align: right;\r\n    }\r\n    .encabezado{\r\n        background-color: #EFEFEF;\r\n    }\r\n</style>";
$sTituloReporte = "FICHA DE INGRESO A BANCO DE PROYECTOS";
//--------------------Contenido del reporte >---------------------------------------------------
$pdf->SetFont('times', 'L', 6);
$pdf->write1DBarcode($infoBcoPDF['IdBco'], 'C39', '', '', '', 12, 0.4, $style, 'N');
$pdf->Ln();
$pdf->SetFont('times', '', 9);
$pdf->Cell(0, 0, strtoupper($sTituloReporte), 0, 1, 'C', 0, 1);
$pdf->Ln(2);
Example #15
0
<?php

$pdf = new MYPDF();
//$pdf->setMargins(20,20,20);
$pdf->AliasNbPages();
$pdf->AddPage('L', 'A4');
$pdf->AddFont('PT_Serif-Web-Bold', '', 'PT_Serif-Web-Bold.php');
$pdf->SetFont('PT_Serif-Web-Bold', '', 32);
$pdf->image('./images/lippo.jpg', 25, 4, 50, 30);
$pdf->Text(290 / 2 - $pdf->GetStringWidth('Lumiere Club') / 2, 15, 'Lumiere Club');
$pdf->SetFont('PT_Serif-Web-Bold', '', 30);
$pdf->Text(290 / 2 - $pdf->GetStringWidth('Lippo Mall Kemang') / 2, 26, 'Lippo Mall Kemang');
$pdf->SetFont('Times', '', 12);
$pdf->Text(290 / 2 - $pdf->GetStringWidth('Jl. Pangeran Antasari 36 Jakarta Selatan - 12150') / 2, 33, 'Jl. Pangeran Antasari 36 Jakarta Selatan - 12150');
//$pdf->setDrawColor(105,102,102);
$pdf->Line(10, 36, 290 - 5, 36);
$pdf->SetFont('Arial', '', 22);
$pdf->Text(290 / 2 - $pdf->GetStringWidth('Report Data Upgrade Membership') / 2, 45, 'Report Data Upgrade Membership');
$awal = date('d F Y', strtotime($tgl1));
$akhir = date('d F Y', strtotime($tgl2));
$periode = "{$awal} to {$akhir}";
$pdf->SetFont('Arial', '', 14);
$pdf->Text(290 / 2 - $pdf->GetStringWidth($periode) / 2, 54, $periode);
//$pdf->Line(10, 10, 210-10, 10);
$pdf->SetXY(10, 60);
$pdf->SetFont('Helvetica', '', 12);
$content = UpgradeMembership::model()->with(array('member', 'user'))->findAll(array('condition' => 'upgrade_date BETWEEN :date1 AND :date2', 'params' => array(':date1' => $tgl1, ':date2' => $tgl2)));
if ($content == null) {
    $pdf->SetFont('Helvetica', '', 48);
    $pdf->Text(290 / 2 - $pdf->GetStringWidth("No Data Found") / 2, 84, "No Data Found");
    $pdf->Output();
// set document information
$pdf->SetCreator(PDF_CREATOR);
//$pdf->SetAuthor(api_account($training->addIdAccount)->name);
$pdf->SetTitle("Dettaglio allenamenti svolti");
//$pdf->SetSubject("Training nr. ".$training->number." - ".api_timestampFormat($request->timestamp,api_text("date")));
// header and footer
$pdf->setPrintHeader(true);
$pdf->setPrintFooter(true);
// set margins
$pdf->SetMargins(10, 30, 10);
$pdf->SetHeaderMargin(30);
$pdf->SetFooterMargin(10);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 15);
// set font
$pdf->SetFont('freesans', '', 12, '', true);
// add a page
$pdf->AddPage();
// page styles
$pdf->SetTextColor(0);
$pdf->SetFillColor(245);
$fill = FALSE;
// border
$border = '';
// header
$pdf->SetFont('freesans', '', 8, '', true);
$pdf->Cell(25, 3, mb_strtoupper(api_text("module-diary_export-sport"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Cell(25, 3, mb_strtoupper(api_text("module-diary_export-sort"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Cell(35, 3, mb_strtoupper(api_text("module-diary_export-time"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Cell(25, 3, mb_strtoupper(api_text("module-diary_export-distance"), 'UTF-8'), $border, 0, 'L', false);
$pdf->Cell(130, 3, mb_strtoupper(api_text("module-diary_export-description"), 'UTF-8'), $border, 0, 'L', false);
Example #17
0
             //Arial italic 8
             $this->SetFont('DejaVu Sans B', 'I', 8);
             //Text color in gray
             $this->SetTextColor(128);
             //Page number
             $this->Cell(0, 10, 'Stranica ' . $this->PageNo(), 0, 0, 'C');
         }
     }
 }
 // Prva stranica
 $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
 $pdf->AddFont("DejaVuSans", "", "DejaVuSans.php");
 $pdf->AddFont("DejaVuSans", "", "DejaVuSans-Bold.php");
 $pdf->AddPage();
 $pdf->SetY(100);
 $pdf->SetFont('DejaVuSans', '', 30);
 $pdf->Cell(190, 10, $imezad, 0, 0, 'C');
 $pdf->Ln();
 $pdf->SetFont('DejaVuSans', '', 16);
 $pdf->Cell(190, 10, $imepredmeta, 0, 0, 'C');
 $pdf->SetY(-90);
 $pdf->SetFont('DejaVu Sans', '', 12);
 $pdf->Cell(40, 10, 'Student:');
 $pdf->SetFont('DejaVu Sans B', '', 12);
 $pdf->Cell(24, 10, $ime . ' ' . $prezime, 0, 0, 'C');
 $pdf->Ln();
 if ($labgrupa != "") {
     $pdf->SetFont('DejaVu Sans', '', 12);
     $pdf->Cell(40, 10, 'Grupa:');
     $pdf->SetFont('DejaVu Sans', '', 12);
     $pdf->Cell(19, 10, $labgrupa, 0, 0, 'C');
Example #18
0
$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);
//initialize document
$pdf->AliasNbPages();
// add a page
$pdf->AddPage();
// ---------------------------------------------------------
// set font
$pdf->SetFont("times", "", 9);
//$pdf->SetCellPadding(0);
//$pdf->SetLineWidth(2);
$text = "Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis. Cras nulla nulla, hendrerit et, porttitor eu, adipiscing et, lorem. Pellentesque sit amet augue. Nam lobortis sollicitudin turpis. Sed velit est, mollis non, elementum ac, tempor quis, arcu. Aliquam a pede. Quisque arcu magna, nonummy eget, hendrerit a, lacinia egestas, enim. Donec bibendum. In a ipsum. Sed gravida facilisis sem. Nam tempus, tellus ut tincidunt elementum, augue tellus fermentum quam, sit amet lobortis sem ipsum sed elit.In accumsan ligula nonummy libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed vel risus. Vestibulum ut lacus. Proin fermentum, erat a commodo lacinia, lacus dui hendrerit nulla, et pellentesque neque diam at elit. Fusce blandit, dolor pharetra bibendum lacinia, augue sem scelerisque sem, bibendum sodales orci justo et sapien. Etiam nec eros ac turpis lobortis interdum. Integer volutpat nibh a lacus. Duis erat est, rhoncus nec, rhoncus viverra, pulvinar sit amet, leo. Duis blandit. Nunc convallis nisi ac ante. Cras nunc massa, molestie quis, porttitor a, volutpat accumsan, quam. Nullam a erat vitae orci bibendum viverra. Donec tristique leo eget nisl adipiscing pellentesque. Nam vehicula, enim quis aliquet euismod, dolor sem pellentesque libero, nec blandit nisi erat sit amet dui. Integer sapien. Donec molestie metus in neque. Suspendisse porttitor enim a nisl.Maecenas lacinia dolor ornare ligula. Maecenas eu eros. Curabitur non leo non nulla fringilla auctor. Etiam porttitor diam vel quam. Maecenas sed ligula nec massa venenatis faucibus. Curabitur aliquet accumsan tellus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse vitae eros ac purus fermentum suscipit. Curabitur interdum orci a mi. Nunc placerat diam in elit.Nunc elit. Maecenas vulputate, sem sit amet condimentum lacinia, ipsum eros porta dolor, sed luctus magna ante eu nisl. Proin non nisi. Vivamus sed quam et est lobortis porttitor. Cras sit amet urna sit amet elit ultricies consequat. Praesent blandit elit ut urna. Cras hendrerit rhoncus sapien. Fusce ullamcorper lobortis ipsum. Pellentesque vel velit at sem blandit facilisis. Nulla aliquet orci id metus.";
// print some rows just as example
for ($i = 0; $i < 5; $i++) {
    $pdf->MultiRow("Row " . ($i + 1), $text . "\n");
}
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output("example_020.pdf", "I");
//============================================================+
// END OF FILE
//============================================================+
Example #19
0
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// 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('times', '', 9);
// add a page
$pdf->AddPage();
//$pdf->SetCellPadding(0);
//$pdf->SetLineWidth(2);
$text = 'Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis. Cras nulla nulla, hendrerit et, porttitor eu, adipiscing et, lorem. Pellentesque sit amet augue. Nam lobortis sollicitudin turpis. Sed velit est, mollis non, elementum ac, tempor quis, arcu. Aliquam a pede. Quisque arcu magna, nonummy eget, hendrerit a, lacinia egestas, enim. Donec bibendum. In a ipsum. Sed gravida facilisis sem. Nam tempus, tellus ut tincidunt elementum, augue tellus fermentum quam, sit amet lobortis sem ipsum sed elit.In accumsan ligula nonummy libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed vel risus. Vestibulum ut lacus. Proin fermentum, erat a commodo lacinia, lacus dui hendrerit nulla, et pellentesque neque diam at elit. Fusce blandit, dolor pharetra bibendum lacinia, augue sem scelerisque sem, bibendum sodales orci justo et sapien. Etiam nec eros ac turpis lobortis interdum. Integer volutpat nibh a lacus. Duis erat est, rhoncus nec, rhoncus viverra, pulvinar sit amet, leo. Duis blandit. Nunc convallis nisi ac ante. Cras nunc massa, molestie quis, porttitor a, volutpat accumsan, quam. Nullam a erat vitae orci bibendum viverra. Donec tristique leo eget nisl adipiscing pellentesque. Nam vehicula, enim quis aliquet euismod, dolor sem pellentesque libero, nec blandit nisi erat sit amet dui. Integer sapien. Donec molestie metus in neque. Suspendisse porttitor enim a nisl.Maecenas lacinia dolor ornare ligula. Maecenas eu eros. Curabitur non leo non nulla fringilla auctor. Etiam porttitor diam vel quam. Maecenas sed ligula nec massa venenatis faucibus. Curabitur aliquet accumsan tellus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse vitae eros ac purus fermentum suscipit. Curabitur interdum orci a mi. Nunc placerat diam in elit.Nunc elit. Maecenas vulputate, sem sit amet condimentum lacinia, ipsum eros porta dolor, sed luctus magna ante eu nisl. Proin non nisi. Vivamus sed quam et est lobortis porttitor. Cras sit amet urna sit amet elit ultricies consequat. Praesent blandit elit ut urna. Cras hendrerit rhoncus sapien. Fusce ullamcorper lobortis ipsum. Pellentesque vel velit at sem blandit facilisis. Nulla aliquet orci id metus.';
// print some rows just as example
for ($i = 0; $i < 5; $i++) {
    $pdf->MultiRow('Row ' . ($i + 1), $text . "\n");
}
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_020.pdf', 'I');
//============================================================+
Example #20
0
 function generatePdfReport($pdfData, $mode, $params, $fileName)
 {
     $countries = CJFunctions::get_country_names();
     $responses = array();
     $include_email_in_reports = $params->get('include_email_in_reports', 0);
     foreach ($pdfData->responses as $response) {
         $responses[$response->id] = new stdClass();
         $responses[$response->id]->created_by = $response->created_by;
         $responses[$response->id]->created = $response->created;
         $responses[$response->id]->username = $response->username;
         $responses[$response->id]->name = $response->name;
         if ($include_email_in_reports == 1) {
             $responses[$response->id]->email = $response->email;
         }
         $responses[$response->id]->questions = array();
         foreach ($pdfData->questions as $question) {
             $responses[$response->id]->questions[$question->id] = new stdClass();
             $responses[$response->id]->questions[$question->id]->answer = '';
             $responses[$response->id]->questions[$question->id]->question_type = $question->question_type;
         }
     }
     if (!empty($pdfData->entries)) {
         foreach ($pdfData->entries as $entry) {
             if (isset($responses[$entry->response_id]) && isset($responses[$entry->response_id]->questions[$entry->question_id])) {
                 if (!empty($entry->answer)) {
                     if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->answer;
                     } else {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->answer;
                     }
                     if (!empty($entry->answer_image) && JFile::exists(S_IMAGES_UPLOAD_DIR . '/' . $entry->answer_image)) {
                         //$image = JHtml::image(JURI::root(true).'/media/communitysurveys/images/'.$entry->answer_image, $entry->answer);
                         $image = '<img src="' . JURI::root(true) . '/media/communitysurveys/images/' . $entry->answer_image . '">';
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $image;
                     }
                 }
                 if (!empty($entry->answer2)) {
                     if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->answer2;
                     } else {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->answer2;
                     }
                 }
                 if (!empty($entry->free_text)) {
                     // do special types formatting //
                     if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_NAME) {
                         $names = explode('|', $entry->free_text);
                         if (!empty($names)) {
                             $entry->free_text = $names[0] . '. ' . $names[1] . ' ' . $names[2];
                         } else {
                             $entry->free_text = '';
                         }
                     } else {
                         if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_ADDRESS) {
                             $parts = explode('|||', $entry->free_text);
                             if (count($parts) == 7) {
                                 $entry->free_text = '<address><strong>' . CJFunctions::escape($parts[0]) . '</strong><br>';
                                 $entry->free_text .= CJFunctions::escape($parts[1]) . '<br>';
                                 if (!empty($parts[2])) {
                                     $entry->free_text .= CJFunctions::escape($parts[2]) . '<br>';
                                 }
                                 $entry->free_text .= CJFunctions::escape($parts[3]) . ', ' . CJFunctions::escape($parts[4]) . ', ' . CJFunctions::escape($parts[6]) . '<br>';
                                 $entry->free_text .= !empty($countries[$parts[5]]) ? $countries[$parts[5]]->country_name : CJFunctions::escape($parts[5]);
                             } else {
                                 $entry->free_text = '';
                             }
                         }
                     }
                     // do special types formatting //
                     if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->free_text;
                     } else {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->free_text;
                     }
                 }
             }
         }
     }
     $response_rows = array();
     foreach ($responses as $id => $response) {
         $string = '<table class="table table-striped" width="100%">';
         $string = $string . '<tr><th width="30%"><strong>Response ID:</strong></th><td width="70%">' . $id . '</td></tr>';
         $string = $string . '<tr><th><strong>Response Date:</strong></th><td>' . $response->created . '</td></tr>';
         $string = $string . '<tr><th><strong>User ID:</strong></th><td>' . $response->created_by . '</td></tr>';
         $string = $string . '<tr><th><strong>Username:</strong></th><td>' . $response->username . '</td></tr>';
         $string = $string . '<tr><th><strong>User Display Name:</strong></th><td>' . $response->name . '</td></tr>';
         if ($include_email_in_reports == 1) {
             $string = $string . '<tr><td><strong>Email:</strong></td><td>' . $response->email . '</td></tr>';
         }
         foreach ($pdfData->questions as $question) {
             $string = $string . '<tr><td colspan="2">&nbsp;<hr></td></tr>';
             $string = $string . '<tr><th colspan="2"><h3>' . $question->title . '</h3></th></tr>';
             if (!empty($question->description)) {
                 $string = $string . '<tr><td colspan="2">' . $question->description . '</td></tr>';
             }
             $string = $string . '<tr><td colspan="2">&nbsp;</td></tr>';
             $string = $string . '<tr><td colspan="2">' . $response->questions[$question->id]->answer . '</td></tr>';
         }
         $string = $string . '</table>';
         array_push($response_rows, $string);
     }
     // create new PDF document
     require_once JPATH_COMPONENT_SITE . '/helpers/tcpdf.php';
     $pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set default header data
     $pdf->SetHeaderData('logo.png', PDF_HEADER_LOGO_WIDTH, $pdfData->title, '');
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('corejoomla.com');
     $pdf->SetTitle('Survey Report');
     $pdf->SetSubject('Survey Responses Report');
     $pdf->SetKeywords('survey, report');
     // 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));
     // 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 font
     $pdf->SetFont('freesans');
     foreach ($response_rows as $i => $response) {
         $pdf->AddPage();
         $pdf->writeHTML($response, true, false, true, false, '');
         $pdf->lastPage();
     }
     $pdf->Output($fileName, $mode);
 }
Example #21
0
// 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 (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
//$pdf->SetFont('helvetica', 'B', 16);
// add a page
$pdf->AddPage();
//$pdf->Write(0, 'Taller industrial Servi Torno tiene el agrado de cotizarle los siguientes servicios:', '', 0, 'L', true, 0, false, false, 0);
$pdf->SetFont('helvetica', '', 8);
///////////////////////////////////////////////////////
//////////////encabezado//////////////////
////////////////////////////////////////////////////////
$tbl = <<<EOD



<div id="wb_Text20" style="position:absolute;left:380px;top:72px;width:150px;height:16px;text-align:center;z-index:2;">
<span style="color:#00008B;font-family:'Bookman Old Style';font-size:10px;"><strong><em>CENTRO DE MECANIZADO, TORNO, FRESADORA, RECTIFICADORA DE SUPERFICIES PLANAS, RECTIFICADORA DE EJES, CEPILLO, PRENSA HIDRÁULICA, 
SOLDADURAS: ELÉCTRICA Y AUTÓGENA; REPARACIÓN Y FABRICACIÓN DE PIEZAS <br> AGRO-INDRUSTRIALES
</em></strong></span></div>

<hr id="Line1" style="margin:0;padding:0;position:absolute;left:0px;top:44px;width:625px;height:2px;z-index:1;">
<div id="wb_Text5" style="position:absolute;left:334px;top:127px;width:335px;height:18px;z-index:7;text-align:left;">
<span style="color:#000000;font-family:'Bookman Old Style';font-size:13px;">Liquidacion de Horas Extras {$fecha}</span></div>
Example #22
0
// 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 (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 20);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of text layout using Multicell()', '', 0, 'L', true, 0, false, false, 0);
$pdf->Ln(5);
$pdf->SetFont('times', '', 9);
//$pdf->SetCellPadding(0);
//$pdf->SetLineWidth(2);
// set color for background
$pdf->SetFillColor(255, 255, 200);
$text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.

Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.';
// print some rows just as example
for ($i = 0; $i < 10; ++$i) {
    $pdf->MultiRow('Row ' . ($i + 1), $text . "\n");
Example #23
0
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, 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));
// 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 font
$pdf->SetFont('times', '', 10);
// add a page
$pdf->AddPage();
//print_r($_POST);
$turno = $_POST['Turno'];
$area = utf8_encode($_POST['area']);
//echo $area;
$fechaTurno = $_POST['fechaTurno'];
$cuerpo = "";
for ($i = 0; $i < count($_POST['idSol']); $i++) {
    $cuerpo .= "<tr>";
    $cuerpo .= "<td>" . $_POST['idSol'][$i] . "</td><td>" . $_POST['ue'][$i] . "</td><td>" . $_POST['tipo'][$i] . "</td>";
    $cuerpo .= "</tr>";
}
$cuerpo = utf8_encode($cuerpo);
//echo $cuerpo;
Example #24
0
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(0);
$pdf->SetFooterMargin(0);
// remove default footer
$pdf->setPrintFooter(false);
//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('times', '', 48);
// add a page
$pdf->AddPage();
// Print a text
$html = '<span style="background-color:yellow;color:blue;">&nbsp;PAGE 1&nbsp;</span>
<p stroke="0.2" fill="true" strokecolor="yellow" color="blue" style="font-family:helvetica;font-weight:bold;font-size:26pt;">You can set a full page background.</p>';
$pdf->writeHTML($html, true, false, true, false, '');
// add a page
$pdf->AddPage();
// Print a text
$html = '<span style="background-color:yellow;color:blue;">&nbsp;PAGE 2&nbsp;</span>';
$pdf->writeHTML($html, true, false, true, false, '');
// --- example with background set on page ---
// remove default header
$pdf->setPrintHeader(false);
// add a page
Example #25
0
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// 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('helvetica', '', 12);
// add a page
$pdf->AddPage();
//Column titles
$header = array('Country', 'Capital', 'Area (sq km)', 'Pop. (thousands)');
//Data loading
$data = $pdf->LoadData('../cache/table_data_demo.txt');
// print colored table
$pdf->ColoredTable($header, $data);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_011.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
Example #26
0
    public function cetak($idquotationsales = null, $idrefstore = null)
    {
        if ($idquotationsales == null) {
            exit('Data Tidak Tersedia');
        }
        $data = $this->orm->quotationsales->where('idquotationsales', $idquotationsales)->fetch();
        if (count($this->orm->quotationsales->where('idquotationsales', $idquotationsales)) == 0) {
            echo "<h3>Data Tidak Tersedia</h3>";
            exit;
        }
        //check from web
        if ($idrefstore == null) {
            $email = $_SESSION['user']['email'];
            $idrefstore = $_SESSION['user']['idrefstore'];
        } else {
            //from mobile
            $email = $this->input->post('email');
        }
        ini_set('memory_limit', '512M');
        $this->load->library('TCPDF');
        // create new PDF document
        $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'A4', true, 'UTF-8', false);
        // set document information
        $pdf->SetCreator(WEB_TITLE);
        $pdf->SetAuthor($email);
        $pdf->SetTitle("Quotation - " . $data['nomor']);
        $pdf->SetSubject($data['nomor']);
        $pdf->nomor = $data['nomor'];
        $pdf->tanggal = $data['tanggal'];
        $pdf->namaPelanggan = $data->pelanggan['namapelanggan'];
        $pdf->dibuat_oleh = $data['dibuat_oleh'];
        $pdf->oleh = $email;
        $pdf->store = $this->orm->refstore->where('idrefstore', $idrefstore)->fetch();
        // set default monospaced font
        $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
        //set margins
        $pdf->SetMargins(5, 63, 5);
        $pdf->SetHeaderMargin(14);
        $pdf->SetFooterMargin(80);
        //set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, 80);
        //set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, 80);
        //set image scale factor
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
        // ---------------------------------------------------------
        // set default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        // dejavusans is a UTF-8 Unicode font, if you only need to
        // print standard ASCII chars, you can use core fonts like
        // helvetica or times to reduce file size.
        // use the font
        $pdf->SetFont('times', '', 10, '', false);
        // Add a page
        // This method has several options, check the source code documentation for more information.
        $resolution = array(310, 210);
        $pdf->AddPage('L', $resolution);
        // Set some content to print
        $html = '
            
            <style>
            body {
            letter-spacing:5px;
            }      
            </style> 
            	<style type="text/css">
            .rotate-text
             {

            /* Safari */
            -webkit-transform: rotate(-90deg);

            /* Firefox */
            -moz-transform: rotate(-90deg);

            /* IE */
            -ms-transform: rotate(-90deg);

            /* Opera */
            -o-transform: rotate(-90deg);

            /* Internet Explorer */
            filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

            }
            .border-table{
            	border:0.5px solid #000;
            		
            }

            table {
            padding-top:2px;
            }

            </style>
            	
            <body>
              <table border="1">
             <tr><th style="text-align: center;" width="60"> No </th><th width="180" style="text-align: center;"> Nama Barang </th><th style="text-align: center;" width="100"> Jumlah Barang </th><th style="text-align: center;" width="300"> Harga Satuan </th><td style="text-align: center; "width="300"> Keterangan </td></tr>
            ';
        $no = 1;
        foreach ($this->orm->quotationsalesdetail->where('idquotationsales', $idquotationsales) as $row) {
            $html .= "<tr><td>" . $no . "</td><td>" . $row->refbarang['namabarang'] . "</td><td style=\"text-align: right;\">" . $row['jumlahbarang'] . "</td><td style=\"text-align: right;\">" . number_format($row['hargasatuan'], 0, ',', '.') . "</td><td>" . $row['keterangan'] . "</td></tr>";
            $no++;
        }
        $html .= '</table>
</body>';
        //print_r($html); exit;
        // Print text using writeHTMLCell()
        $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
        //$pdf->writeHTML($html, true, 0, true, true);
        // ---------------------------------------------------------
        // Close and output PDF document
        // This method has several options, check the source code documentation for more information.
        $pdf->Output("Quotation - " . $data['nomor'], 'I');
        //============================================================+
        // END OF FILE
        //============================================================+
    }
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// 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('times', 'BI', 12);
// add a page
$pdf->AddPage();
$pdf->AddPage();
// set some text to print
$txt = <<<EOD
TCPDF Example 003

Custom page header and footer are defined by extending the TCPDF class and overriding the Header() and Footer() methods.
EOD;
// print a block of text using Write()
$pdf->Write($h = 0, $txt, $link = '', $fill = 0, $align = 'C', $ln = true, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_003.pdf', 'I');
//============================================================+
Example #28
0
 function checkStoreInvoice($orderDetails = 0)
 {
     JRequest::setVar('task', 'checkStoreInvoice');
     $force = true;
     //	@ini_set( 'max_execution_time', 5 );
     $path = VmConfig::get('forSale_path', 0);
     if ($path === 0) {
         vmError('No path set to store invoices');
         return false;
     } else {
         $path .= 'invoices' . DS;
         if (!file_exists($path)) {
             vmError('Path wrong to store invoices, folder invoices does not exist ' . $path);
             return false;
         } else {
             if (!is_writable($path)) {
                 vmError('Cannot store pdf, directory not writeable ' . $path);
                 return false;
             }
         }
     }
     $orderModel = VmModel::getModel('orders');
     $invoiceNumberDate = array();
     if (!$orderModel->createInvoiceNumber($orderDetails['details']['BT'], $invoiceNumberDate)) {
         return 0;
     }
     if (!empty($invoiceNumberDate[0])) {
         $invoiceNumber = $invoiceNumberDate[0];
     } else {
         $invoiceNumber = FALSE;
     }
     if (!$invoiceNumber or empty($invoiceNumber)) {
         vmError('Cant create pdf, createInvoiceNumber failed');
         return 0;
     }
     if (shopFunctions::InvoiceNumberReserved($invoiceNumber)) {
         return 0;
     }
     $path .= 'vminvoice_' . $invoiceNumber . '.pdf';
     if (file_exists($path) and !$force) {
         return $path;
     }
     // 			$app = JFactory::getApplication('site');
     //We come from the be, so we need to load the FE langauge
     $jlang = JFactory::getLanguage();
     $jlang->load('com_virtuemart', JPATH_SITE, 'en-GB', true);
     $jlang->load('com_virtuemart', JPATH_SITE, $jlang->getDefault(), true);
     $jlang->load('com_virtuemart', JPATH_SITE, null, true);
     $this->addViewPath(JPATH_VM_SITE . DS . 'views');
     $format = 'html';
     $viewName = 'invoice';
     $view = $this->getView($viewName, $format);
     $view->addTemplatePath(JPATH_VM_SITE . DS . 'views' . DS . 'invoice' . DS . 'tmpl');
     $view->invoiceNumber = $invoiceNumberDate[0];
     $view->invoiceDate = $invoiceNumberDate[1];
     $view->orderDetails = $orderDetails;
     $view->uselayout = 'invoice';
     ob_start();
     $view->display();
     $html = ob_get_contents();
     ob_end_clean();
     // create new PDF document
     $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator('Invoice by VirtueMart 2, used library tcpdf');
     $pdf->SetAuthor($view->vendor->vendor_name);
     $pdf->SetTitle(JText::_('COM_VIRTUEMART_INVOICE_TITLE'));
     $pdf->SetSubject(JText::sprintf('COM_VIRTUEMART_INVOICE_SUBJ', $view->vendor->vendor_store_name));
     $pdf->SetKeywords('Invoice by VirtueMart 2');
     //virtuemart.cloudaccess.net/index.php?option=com_virtuemart&view=invoice&layout=details&virtuemart_order_id=18&order_number=6e074d9b&order_pass=p_9cb9e2&task=checkStoreInvoice
     if (empty($view->vendor->images[0])) {
         vmError('Vendor image given path empty ');
     } else {
         if (empty($view->vendor->images[0]->file_url_folder) or empty($view->vendor->images[0]->file_name) or empty($view->vendor->images[0]->file_extension)) {
             vmError('Vendor image given image is not complete ' . $view->vendor->images[0]->file_url_folder . $view->vendor->images[0]->file_name . '.' . $view->vendor->images[0]->file_extension);
             vmdebug('Vendor image given image is not complete, the given media', $view->vendor->images[0]);
         } else {
             if (!empty($view->vendor->images[0]->file_extension) and strtolower($view->vendor->images[0]->file_extension) == 'png') {
                 vmError('Warning extension of the image is a png, tpcdf has problems with that in the header, choose a jpg or gif');
             } else {
                 $imagePath = DS . str_replace('/', DS, $view->vendor->images[0]->file_url_folder . $view->vendor->images[0]->file_name . '.' . $view->vendor->images[0]->file_extension);
                 if (!file_exists(JPATH_ROOT . $imagePath)) {
                     vmError('Vendor image missing ' . $imagePath);
                 } else {
                     $pdf->SetHeaderData($imagePath, 60, $view->vendor->vendor_store_name, $view->vendorAddress);
                 }
             }
         }
     }
     // set header and footer fonts
     $pdf->setHeaderFont(array('helvetica', '', 8));
     $pdf->setFooterFont(array('helvetica', '', 10));
     // 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);
     //TODO include the right file (in libraries/tcpdf/config/lang set some language-dependent strings
     $l = '';
     $pdf->setLanguageArray($l);
     // set default font subsetting mode
     $pdf->setFontSubsetting(true);
     // Set font
     // dejavusans is a UTF-8 Unicode font, if you only need to
     // print standard ASCII chars, you can use core fonts like
     // helvetica or times to reduce file size.
     $pdf->SetFont('helvetica', '', 8, '', true);
     // Add a page
     // This method has several options, check the source code documentation for more information.
     $pdf->AddPage();
     // Set some content to print
     // $html =
     // Print text using writeHTMLCell()
     $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
     // Close and output PDF document
     // This method has several options, check the source code documentation for more information.
     $pdf->Output($path, 'F');
     return $path;
 }
// set default monospaced font
$pdf->SetDefaultMonospacedFont("courier");
// 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);
// ---------------------------------------------------------
$LM = $pdf->getMargins()['left'];
$RM = $pdf->getMargins()['right'];
$W = $pdf->getPageWidth() - $RM - $LM;
// ---------------------------------------------------------
$pdf->SetFont('helvetica', '', 12);
$pdf->AddPage();
// Print address
$pdf->SetFont('helvetica', '', 10);
foreach ($REC_ADRESS as $line) {
    $pdf->Cell(0, 0, $line, 0, 1);
}
$pdf->SetFont('helvetica', '', 8);
$pdf->ln();
$pdf->Cell(0, 0, $SPECIAL_NOTE, 0, 1);
$pdf->ln();
// ---------------------------------------------------------
$pdf->SetY(90);
$pdf->SetFont('helvetica', '', 12);
$pdf->Image($HEADER_IMG, $pdf->GetX(), $pdf->GetY(), $W, '', 'png', '', 'T', true, 300, '', false, false, 0, true, false, false);
$pdf->SetY(120);
Example #30
0
$pdf->SetSubject('Primera Nota');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set margins
$pdf->SetMargins(15, 20, 15);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// borra la linea de arriba en el area del header
$pdf->setPrintHeader(false);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set some language-dependent strings (optional)
if (@file_exists('/includes/tcpdf/examples/lang/spa.php')) {
    require_once '/includes/tcpdf/examples/lang/spa.php';
    $pdf->setLanguageArray($l);
}
$pdf->SetFont('helvetica', 'B', 11);
$nit = $invoice->account_nit;
$nfac = $invoice->invoice_number;
$nauto = $invoice->number_autho;
$sfc = $invoice->sfc;
// add a page
$pdf->AddPage('P', 'LETTER');
$logoEmpresa = base64_decode($invoice->logo);
$pdf->Image('@' . $logoEmpresa, '14', '10', 50, 20, '', '', 'T', false, 300, '', false, false, 0, false, false, false);
///title
$titleFactura = '<table>
<tr>
<td align="rigth"><font color="#333333">NOTA DE ENTREGA</font></td>
</tr>
</table>';
$pdf->SetFont('helvetica', 'B', 27);