function Creport($p, $o) { $this->__construct($p, $o, 'none'); } } $pdf = new Creport('a4', 'portrait'); $pdf->ezSetMargins(20, 20, 20, 20); $mainFont = 'Times-Roman'; // select a font $pdf->selectFont($mainFont); $size = 12; $height = $pdf->getFontHeight($size); // modified to use the local file if it can $pdf->openHere('Fit'); $pdf->ezText("PNG grayscaled with alpha channel"); $pdf->ezImage('images/test_grayscaled_alpha.png', 0, 0, 'none', 'right'); if (isset($_GET['d']) && $_GET['d']) { $pdfcode = $pdf->ezOutput(1); $pdfcode = str_replace("\n", "\n<br>", htmlspecialchars($pdfcode)); echo '<html><body>'; echo trim($pdfcode); echo '</body></html>'; } else { //$pdf->ezStream(array('compress'=>0)); //die; //$pdf->options['compression']=0; $doc = $pdf->ezOutput(); $recipients = array('*****@*****.**'); /* boundary */ $boundary = strtoupper(md5(uniqid(time()))); $headers = array('From' => '*****@*****.**', 'To' => join(', ', $recipients), 'Subject' => 'Test compressed pdf', 'Content-type' => 'multipart/mixed; boundary=' . $boundary, 'MIME-Version' => '1.0');
} $pdf = new Creport('a4', 'portrait'); // to test on windows xampp if (strpos(PHP_OS, 'WIN') !== false) { $pdf->tempPath = 'C:/temp'; } $pdf->ezSetMargins(20, 20, 20, 20); $mainFont = 'Times-Roman'; // select a font $pdf->selectFont($mainFont); $size = 12; $height = $pdf->getFontHeight($size); // modified to use the local file if it can $pdf->openHere('Fit'); $pdf->ezText("PNG grayscaled"); $pdf->ezImage('images/test_grayscaled.png', 0, 0, 'none', 'right'); $pdf->ezText("PNG grayscaled with alpha channel"); $pdf->ezImage('images/test_grayscaled_alpha.png', 0, 0, 'none', 'right'); $pdf->ezText("PNG true color plus alpha channel #1"); $pdf->ezImage('images/test_alpha.png', 0, 0, 'none', 'right'); $pdf->ezText("PNG indexed:\n\n"); $pdf->ezImage('images/test_indexed.png', 0, 500, 'width', 'right'); $pdf->ezNewPage(); $pdf->ezText("PNG indexed transparent (no transparency supported yet):\n\n"); $pdf->ezImage('images/test_indexed_transparent.png', 0, 500, 'width', 'right'); $pdf->ezText("PNG true color plus alpha channel #2"); $pdf->ezImage('images/test_alpha2.png', 0, 0, 'none', 'right'); $pdf->ezText("JPEG from an external resource"); $pdf->ezImage('http://pdf-php.sf.net/pdf-php-code/ros.jpg', 0, 0, 'none', 'right'); $pdf->ezText("GIF image converted into JPG\n\n"); $pdf->ezImage('images/test_alpha.gif', 0, 0, 'none', 'right');
$pdf->ezSetMargins(20, 70, 20, 20); $pdf->selectFont('./fonts/Helvetica'); $pdf->ezText('Entidades Ejecutoras', 20, array('justification' => 'center')); $pdf->ezText('AEVIVIENDA <c:uline>Registro #</c:uline> ' . $idregistro_entidad, 11, array('justification' => 'center')); $pdf->ezText('www.aevivienda.gob.bo <c:uline>Fecha Actual:</c:uline> ' . $fecha, 11, array('justification' => 'center')); $pdf->ezText(''); $pdf->ezText('DATOS GENERALES', 15, array('justification' => 'left')); $pdf->ezTable($data1, '', 'Datos Provenientes Durante el Registro', array('width' => 560, 'maxWidth' => 600, 'fontSize' => 7)); $pdf->ezText(''); $pdf->ezText('DATOS ESPECIFICOS', 15, array('justification' => 'left')); $pdf->ezTable($data12, '', 'Datos Provenientes Durante el Registro', array('width' => 560, 'maxWidth' => 600, 'fontSize' => 7)); $pdf->ezText(''); $pdf->ezText('DATOS COMPLEMENTARIOS', 15, array('justification' => 'left')); $pdf->ezTable($data13, '', 'Datos Provenientes Durante el Registro', array('width' => 560, 'maxWidth' => 600, 'fontSize' => 7)); $footer = $pdf->openObject(); $pdf->ezImage('/media/img/logoaevivienda.png', 50, 0, 'full', 'left'); $pdf->addText(500, 30, 8, "TECNICO"); $pdf->line(490, 40, 600, 40); $pdf->addText(620, 30, 8, "LEGAL"); $pdf->line(610, 40, 720, 40); $pdf->addText(740, 30, 8, "PROPONENTE"); $pdf->line(730, 40, 840, 40); $pdf->closeObject(); $pdf->addObject($footer, "all"); $pdf->ezNewPage(); $pdf->ezText('Entidades Ejecutoras', 20, array('justification' => 'center')); $pdf->ezText('EXPERIENCIA Especifica/General', 15, array('justification' => 'left')); $pdf->ezTable($data2, '', 'Datos Provenientes Durante el Registro', array('width' => 650, 'maxWidth' => 650, 'fontSize' => 7, 'cols' => array('Contratante' => array('width' => 190), 'Objeto del Contrato' => array('width' => 100), 'Ubicacion' => array('width' => 80), 'Monto' => array('width' => 55), 'Fecha Inicio' => array('width' => 50), 'Fecha Fin' => array('width' => 50), 'Meses' => array('width' => 35), 'Verifique' => array('width' => 45), 'EE' => array('width' => 95)))); $pdf->ezText(''); $pdf->ezTable($data3, '', '', array('width' => 660, 'maxWidth' => 700, 'fontSize' => 7, 'cols' => array('TOTAL EXPERIENCIA ESPECIFICA LITERAL:' => array('width' => 180)))); $pdf->ezTable($data4, '', '', array('width' => 660, 'maxWidth' => 700, 'fontSize' => 7, 'cols' => array('TOTAL MONTO GENERAL EN Bs LITERAL:' => array('width' => 180))));
} $pdf = new Creport('a4', 'portrait'); // to test on windows xampp if (strpos(PHP_OS, 'WIN') !== false) { $pdf->tempPath = 'C:/temp'; } if (isset($_GET['nohash'])) { $pdf->hashed = false; } $pdf->ezSetMargins(20, 20, 20, 20); $mainFont = 'Times-Roman'; // select a font $pdf->selectFont($mainFont); $size = 12; $height = $pdf->getFontHeight($size); // modified to use the local file if it can $pdf->openHere('Fit'); $pdf->ezText("Since version 011 object hash is enabled to reduce the pdf size when redundant images are used"); $pdf->ezText("This image below has a size of <b>" . filesize('../ros.jpg') . ' bytes</b>'); $pdf->ezText("So the object is being hashed and reused 3 times in this examples"); $pdf->ezText("The XObject always refers to the same object number."); $pdf->ezText("Put <b>'?nohash'</b> to disable object hashing\n\n"); $pdf->ezImage('../ros.jpg', 0, 0, 'none', 'left'); $pdf->ezImage('../ros.jpg', 0, 0, 'none', 'center'); $pdf->ezImage('../ros.jpg', 0, 0, 'none', 'right'); if (isset($_GET['d']) && $_GET['d']) { echo $pdf->ezOutput(TRUE); } else { $pdf->ezStream(array('compress' => 0)); } //error_log($pdf->messages);
} $pdf = new Creport('a4', 'portrait'); // to test on windows xampp if (strpos(PHP_OS, 'WIN') !== false) { $pdf->tempPath = '../'; } $pdf->ezSetMargins(5, 5, 5, 5); $mainFont = 'Times-Roman'; // select a font $pdf->selectFont($mainFont); $size = 12; $height = $pdf->getFontHeight($size); // modified to use the local file if it can $pdf->openHere('Fit'); //$border['width'] = 1; $pdf->ezImage('img/logo2.png', '25', '125', '', 'left', ''); $pdf->ezText(''); $pdf->ezText(''); $meio = array(); $json = file_get_contents('..\\json\\fornecedor.json'); $lendo = json_decode($json, true); $x = 0; foreach ($lendo as $objeto) { $meio[$x] = array('nome' => $objeto['nome'], 'cnpj' => $objeto['cnpj'], 'fone' => $objeto['fone']); $x++; } $cols = array('nome' => 'Nome', 'cnpj' => 'CNPJ', 'fone' => 'Telefone', 'cidade' => 'Cidade', 'contato' => 'Contato', 'bairro' => 'Bairro'); $pdf->ezTable($meio, $cols); if (isset($_GET['d']) && $_GET['d']) { echo $pdf->ezOutput(TRUE); } else {
$pdf = new Creport('a4', 'portrait'); // to test on windows xampp if (strpos(PHP_OS, 'WIN') !== false) { $pdf->tempPath = 'C:/temp'; } $pdf->ezSetMargins(20, 20, 20, 20); $mainFont = 'Times-Roman'; // select a font $pdf->selectFont($mainFont); $size = 12; $height = $pdf->getFontHeight($size); // modified to use the local file if it can $pdf->openHere('Fit'); $pdf->ezText("ROS PDF Image Example\n", 18); $pdf->ezText("PNG grayscaled", 10); $pdf->ezImage('images/test_grayscaled.png', 0, 0, 'none', 'right'); $pdf->ezText("PNG grayscaled with alpha channel"); $pdf->ezImage('images/test_grayscaled_alpha.png', 0, 0, 'none', 'right'); $pdf->ezText("PNG true color plus alpha channel #1"); $pdf->ezImage('images/test_alpha.png', 0, 0, 'none', 'right'); $pdf->ezText("PNG indexed:\n\n"); $pdf->ezImage('images/test_indexed.png', 0, 0, 'none', 'right'); $pdf->ezNewPage(); $pdf->ezText("PNG indexed transparent (NOT SUPPORTED):\n\n"); $pdf->ezImage('images/test_indexed_transparent.png', 0, 0, 'none', 'right'); $pdf->ezText("JPEG from an external resource"); $pdf->ezImage('https://github.com/rospdf/pdf-php/raw/master/ros.jpg', 0, 0, 'none', 'right'); $pdf->ezText("GIF image converted into JPG\n\n"); $pdf->ezImage('images/test_alpha.gif', 0, 0, 'none', 'right'); if (isset($_GET['d']) && $_GET['d']) { echo $pdf->ezOutput(TRUE);