<?php require_once 'class.ezpdf.php'; $pdf = new Cezpdf('a4', 'landscape'); $pdf->selectFont('../fonts/courier.afm'); $pdf->ezSetCmMargins(1, 1, 1.5, 1.5); $conexion = mysql_connect("localhost", "admin_root", "OW5wP1dnKC"); mysql_select_db("admin_BD_detenidos", $conexion); $queEmp = "SELECT * FROM vehiculos WHERE id_v='{$_GET['idreg']}'"; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); $ixx = 0; while ($datatmp = mysql_fetch_assoc($resEmp)) { if ($ixx == 0) { } $ixx = $ixx + 1; $pdf->ezImage("img/logo.png", 0, 0, 'none', 'left'); $data[] = array_merge($datatmp, array('num' => $ixx)); } $titles = array('num' => '<b>Num</b>', 'REGISTRO' => '<b>Registro</b>', 'REALIZO' => '<b>Fecha</b>', 'FECHA' => '<b>Realizo</b>', 'DESCRIPCION' => '<b>Descripción</b>', 'COMENTARIOS' => '<b>Comentarios</b>'); $options = array('shadeCol' => array(0.9, 0.9, 0.9), 'xOrientation' => 'center', 'width' => 750); $pdf->ezText($txttit, 10); $pdf->ezTable($data, $titles, '', $options); $pdf->ezStream();
function upload_file_to_client_pdf($file_to_send) { //Function reads a text file and converts to pdf. global $STMT_TEMP_FILE_PDF; $pdf = new Cezpdf('LETTER'); //pdf creation starts $pdf->ezSetMargins(36, 0, 36, 0); $pdf->selectFont($GLOBALS['fileroot'] . "/library/fonts/Courier.afm"); $pdf->ezSetY($pdf->ez['pageHeight'] - $pdf->ez['topMargin']); $countline = 1; $file = fopen($file_to_send, "r"); //this file contains the text to be converted to pdf. while (!feof($file)) { $OneLine = fgets($file); //one line is read if (stristr($OneLine, "\f") == true && !feof($file)) { $pdf->ezNewPage(); $pdf->ezSetY($pdf->ez['pageHeight'] - $pdf->ez['topMargin']); str_replace("\f", "", $OneLine); } if (stristr($OneLine, 'REMIT TO') == true || stristr($OneLine, 'Visit Date') == true) { //lines are made bold when 'REMIT TO' or 'Visit Date' is there. $pdf->ezText('<b>' . $OneLine . '</b>', 12, array('justification' => 'left', 'leading' => 6)); } else { $pdf->ezText($OneLine, 12, array('justification' => 'left', 'leading' => 6)); } $countline++; } $fh = @fopen($STMT_TEMP_FILE_PDF, 'w'); //stored to a pdf file if ($fh) { fwrite($fh, $pdf->ezOutput()); fclose($fh); } header("Pragma: public"); //this section outputs the pdf file to browser header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Length: " . filesize($STMT_TEMP_FILE_PDF)); header("Content-Disposition: attachment; filename=" . basename($STMT_TEMP_FILE_PDF)); header("Content-Description: File Transfer"); readfile($STMT_TEMP_FILE_PDF); // flush the content to the browser. If you don't do this, the text from the subsequent // output from this script will be in the file instead of sent to the browser. flush(); exit; //added to exit from process properly in order to stop bad html code -ehrlive // sleep one second to ensure there's no follow-on. sleep(1); }
public function __construct($paper = 'a4', $orientation = 'portrait', $font = 'Helvetica') { if (!file_exists('tmp/' . FS_TMP_NAME . 'pdf')) { mkdir('tmp/' . FS_TMP_NAME . 'pdf'); } $this->pdf = new Cezpdf($paper, $orientation); $this->pdf->selectFont("plugins/facturacion_base/extras/ezpdf/fonts/" . $font . ".afm"); }
function printPDF($res, $res2, $data) { $pdf = new Cezpdf("LETTER"); $pdf->ezSetMargins(72, 30, 50, 30); $pdf->selectFont('Helvetica'); $opts = array('justification' => "center"); $pdf->ezText($res['facility_address'], "", $opts); $pdf->ezText("\n" . $res2['patient_name'] . "\n" . xl('Date of Birth') . ": " . $res2['patient_DOB'] . "\n" . $res2['patient_address']); $pdf->ezText("\n"); $opts = array('maxWidth' => 550, 'fontSize' => 8); $pdf->ezTable($data, "", $title, $opts); $pdf->ezText("\n\n\n\n" . xl('Signature') . ":________________________________", "", array('justification' => 'right')); $pdf->ezStream(); }
function printPDF($res, $res2, $data) { require_once $GLOBALS['fileroot'] . "/library/classes/class.ezpdf.php"; $pdf = new Cezpdf("LETTER"); $pdf->ezSetMargins(72, 30, 50, 30); $pdf->selectFont($GLOBALS['fileroot'] . "/library/fonts/Helvetica.afm"); $opts = array('justification' => "center"); $pdf->ezText($res['facility_address'], "", $opts); $pdf->ezText("\n" . $res2['patient_name'] . "\n" . xl('Date of Birth') . ": " . $res2['patient_DOB'] . "\n" . $res2['patient_address']); $pdf->ezText("\n"); $opts = array('maxWidth' => 550, 'fontSize' => 8); $pdf->ezTable($data, "", $title, $opts); $pdf->ezText("\n\n\n\n" . xl('Signature') . ":________________________________", "", array('justification' => 'right')); $pdf->ezStream(); }
function generar_pdf() { require_once toba_dir() . '/php/3ros/ezpdf/class.ezpdf.php'; $pdf = new Cezpdf(); $pdf->selectFont(toba_dir() . '/php/3ros/ezpdf/fonts/Helvetica.afm'); $pdf->ezText('Ejemplo Firma Digital. Tiene dos attachments XML', 14); //-- Cuadro con datos $opciones = array('splitRows' => 0, 'rowGap' => 1, 'showHeadings' => true, 'titleFontSize' => 9, 'fontSize' => 10, 'shadeCol' => array(0.9, 0.9, 0.9), 'outerLineThickness' => 0.7, 'innerLineThickness' => 0.7, 'xOrientation' => 'center', 'width' => 500); $this->s__datos_juegos = toba::db()->consultar("SELECT * from ref_juegos"); $pdf->ezTable($this->s__datos_juegos, '', 'Juegos', $opciones); $this->s__datos_deportes = toba::db()->consultar("SELECT * from ref_deportes"); $pdf->ezTable($this->s__datos_deportes, '', 'Deportes', $opciones); $tmp = $pdf->ezOutput(0); $this->s__pdf = array(); $sesion = get_firmador()->generar_sesion(); $this->s__pdf['path'] = toba::proyecto()->get_path_temp() . "/doc{$sesion}_sinfirma.pdf"; if (!file_put_contents($this->s__pdf['path'], $tmp)) { throw new toba_error("Imposible escribir en '{$this->s__pdf['path']}'. Chequee permisos"); } }
$form = new formular(); $form->fieldset("Monatsbericht", 'monatsbericht'); $b->monatsbericht_mit_ausgezogenen(); $form->fieldset_ende(); break; case "test": ob_clean(); // ausgabepuffer leeren //include_once ('pdfclass/class.ezpdf.php'); $pdf = new Cezpdf('a4', 'portrait'); $pdf->ezSetCmMargins(4.5, 2.5, 2.5, 2.5); $berlus_schrift = 'pdfclass/fonts/Times-Roman.afm'; $text_schrift = 'pdfclass/fonts/Arial.afm'; $pdf->addJpegFromFile('includes/logos/hv_logo198_80.jpg', 450, 780, 100, 42); $pdf->setLineStyle(0.5); $pdf->selectFont($berlus_schrift); $pdf->addText(42, 743, 6, "BERLUS HAUSVERWALTUNG - Fontanestr. 1 - 14193 Berlin"); $pdf->line(42, 750, 550, 750); $seite = $pdf->ezGetCurrentPageNumber(); $alle_seiten = $pdf->ezPageCount; $data55 = array(array('num' => 1, 'name' => 'gandalf', 'type' => 'wizard'), array('num' => 2, 'name' => 'bilbo', 'type' => 'hobbit', 'url' => 'http://www.ros.co. nz/pdf/'), array('num' => 3, 'name' => 'frodo', 'type' => 'hobbit'), array('num' => 4, 'name' => 'saruman', 'type' => 'bad dude', 'url' => 'http://sourceforge.net/projects/pdf-php'), array('num' => 5, 'name' => 'sauron', 'type' => 'really bad dude')); $pdf->ezTable($data55); // header('Content-type: application/pdf'); // header('Content-Disposition: attachment; filename="downloaded.pdf"'); // $output = $pdf->Output(); // $len = strlen($output); // header("Content-type: application/pdf"); // wird von MSIE ignoriert // header("content-length: $len"); // header("Content-Disposition: inline; filename=test.pdf"); //im fenster
date_default_timezone_set('UTC'); include 'Cezpdf.php'; $pdf = new Cezpdf('a4', 'portrait'); // to test on windows xampp if (strpos(PHP_OS, 'WIN') !== false) { $pdf->tempPath = 'C:/temp'; } if (!isset($_GET['nocrypt'])) { // define the encryption mode (either RC4 40bit or RC4 128bit) $user = isset($_GET['user']) ? $_GET['user'] : ''; $owner = isset($_GET['owner']) ? $_GET['owner'] : ''; $mode = isset($_GET['mode']) && is_numeric($_GET['mode']) ? $_GET['mode'] : 1; $pdf->setEncryption($user, $owner, array(), $mode); } // select a font $pdf->selectFont('Times-Roman'); $pdf->openHere('Fit'); $pdf->ezText("This example shows how to crypt the PDF document\n"); $pdf->ezText("\nUse \"?mode=1\" for RC4 40bit encryption\n"); $pdf->ezText("\nUse \"?mode=2\" for RC4 128bit encryption\n"); $pdf->ezText("\nUse \"?nocrypt\" to disable the encryption\n"); $pdf->ezText("\nUse \"?user=password\" to set a user password\n"); $pdf->ezText("\nUse \"?owner=password\" to set a owner password\n"); if (isset($_GET['nocrypt'])) { $pdf->ezText("<b>Not encrypt</b> - nocrypt parameter found"); } if (isset($_GET['d']) && $_GET['d']) { echo $pdf->ezOutput(TRUE); } else { if ($mode > 1) { $encMode = "128BIT";
function printPDF($p_params) { $pbConfig = new PluginBarcodeConfig(); // create barcodes $ext = 'png'; $type = $p_params['type']; $size = $p_params['size']; $orientation = $p_params['orientation']; $codes = array(); if ($type == 'QRcode') { $codes = $p_params['codes']; } else { if (isset($p_params['code'])) { if (isset($p_params['nb']) and $p_params['nb'] > 1) { $this->create($p_params['code'], $type, $ext); for ($i = 1; $i <= $p_params['nb']; $i++) { $codes[] = $p_params['code']; } } else { if (!$this->create($p_params['code'], $type, $ext)) { Session::addMessageAfterRedirect(__('The generation of some bacodes produced errors.', 'barcode')); } $codes[] = $p_params['code']; } } elseif (isset($p_params['codes'])) { $codes = $p_params['codes']; foreach ($codes as $code) { if ($code != '') { $this->create($code, $type, $ext); } } } else { // TODO : erreur ? // print_r($p_params); return 0; } } // create pdf // x is horizontal axis and y is vertical // x=0 and y=0 in bottom left hand corner $config = $pbConfig->getConfigType($type); require_once GLPI_ROOT . "/plugins/barcode/lib/ezpdf/class.ezpdf.php"; $pdf = new Cezpdf($size, $orientation); $pdf->selectFont(GLPI_ROOT . "/plugins/barcode/lib/ezpdf/fonts/Helvetica.afm"); $pdf->ezStartPageNumbers($pdf->ez['pageWidth'] - 30, 10, 10, 'left', '{PAGENUM} / {TOTALPAGENUM}') . ($width = $config['maxCodeWidth']); $height = $config['maxCodeHeight']; $marginH = $config['marginHorizontal']; $marginV = $config['marginVertical']; $heightimage = $height; if (file_exists(GLPI_PLUGIN_DOC_DIR . '/barcode/logo.png')) { // Add logo to barcode $heightLogomax = 20; $imgSize = getimagesize(GLPI_PLUGIN_DOC_DIR . '/barcode/logo.png'); $logoWidth = $imgSize[0]; $logoHeight = $imgSize[1]; if ($logoHeight > $heightLogomax) { $ratio = 100 * $heightLogomax / $logoHeight; $logoHeight = $heightLogomax; $logoWidth = $logoWidth * ($ratio / 100); } if ($logoWidth > $width) { $ratio = 100 * $width / $logoWidth; $logoWidth = $width; $logoHeight = $logoHeight * ($ratio / 100); } $heightyposText = $height - $logoHeight; $heightimage = $heightyposText; } $first = true; foreach ($codes as $code) { if ($first) { $x = $pdf->ez['leftMargin']; $y = $pdf->ez['pageHeight'] - $pdf->ez['topMargin'] - $height; $first = false; } else { if ($x + $width + $marginH > $pdf->ez['pageWidth']) { // new line $x = $pdf->ez['leftMargin']; if ($y - $height - $marginV < $pdf->ez['bottomMargin']) { // new page $pdf->ezNewPage(); $y = $pdf->ez['pageHeight'] - $pdf->ez['topMargin'] - $height; } else { $y -= $height + $marginV; } } } if ($code != '') { if ($type == 'QRcode') { $imgFile = $code; } else { $imgFile = $this->docsPath . $code . '_' . $type . '.' . $ext; } if (file_exists($imgFile)) { $imgSize = getimagesize($imgFile); $imgWidth = $imgSize[0]; $imgHeight = $imgSize[1]; if ($imgWidth > $width) { $ratio = 100 * $width / $imgWidth; $imgWidth = $width; $imgHeight = $imgHeight * ($ratio / 100); } if ($imgHeight > $heightimage) { $ratio = 100 * $heightimage / $imgHeight; $imgHeight = $heightimage; $imgWidth = $imgWidth * ($ratio / 100); } $image = imagecreatefrompng($imgFile); if ($imgWidth < $width) { $pdf->addImage($image, $x + ($width - $imgWidth) / 2, $y, $imgWidth, $imgHeight); } else { $pdf->addImage($image, $x, $y, $imgWidth, $imgHeight); } if (file_exists(GLPI_PLUGIN_DOC_DIR . '/barcode/logo.png')) { $logoimg = imagecreatefrompng(GLPI_PLUGIN_DOC_DIR . '/barcode/logo.png'); $pdf->addImage($logoimg, $x + ($width - $logoWidth) / 2, $y + $heightyposText, $logoWidth, $logoHeight); } if ($p_params['border']) { $pdf->Rectangle($x, $y, $width, $height); } } } $x += $width + $marginH; $y -= 0; } $file = $pdf->ezOutput(); $pdfFile = $_SESSION['glpiID'] . '_' . $type . '.pdf'; file_put_contents($this->docsPath . $pdfFile, $file); return '/files/_plugins/barcode/' . $pdfFile; }
// Tampil Jadwal default: $thn_skrg = date("Y"); echo "<h2>Cari Jadwal Kuliah</h2>\n<form method=POST action='modul/mod_jadwal/cetakjadwal.php'>\n<table>\n<tr>\n\t<td>Tahun Ajaran</td>\n\t<td> : <select name=tahun>"; for ($ta = 2009; $ta <= $thn_skrg; $ta++) { $ts = $ta + 1; echo "<option value={$ta} selected>{$ta}/{$ts}</option>"; } echo "</select>\n\t</td>\n</tr>\n<tr>\n<td colspan=2><input type=submit value='Tampilkan Jadwal'></td>\n</tr>\n</table>\n</form>"; break; case "cetakdatakrs": include 'modul/mod_cetakkrs/class.ezpdf.php'; $pdf = new Cezpdf(); // Set margin dan font $pdf->ezSetCmMargins(3, 3, 3, 3); $pdf->selectFont('modul/mod_cetakkrs/fonts/Courier.afm'); $all = $pdf->openObject(); // Tampilkan logo //$pdf->setStrokeColor(0, 0, 0, 1); //$pdf->addJpegFromFile('logo.jpg',20,800,69); // Teks di tengah atas untuk judul header $pdf->addText(200, 820, 16, '<b>KARTU RENCANA STUDI</b>'); $pdf->addText(200, 800, 14, '<b>UNIVERSITAS ISLAM NEGERI SUNAN GUNUNG DJATI BANDUNG</b>'); // Garis atas untuk header $pdf->line(10, 795, 578, 795); // Garis bawah untuk footer $pdf->line(10, 50, 578, 50); // Teks kiri bawah $pdf->addText(30, 34, 8, 'Dicetak tgl:' . date('d-m-Y, H:i:s')); $pdf->closeObject(); // Tampilkan object di semua halaman
/** * Crea un pdf con el estado de cuenta de el cliente especificado * @param Array $args, $args['id_cliente'=>12[,'tipo_venta'=> 'credito | contado | saldo'] ], por default obtiene todas las compras del cliente */ public static function imprimirEstadoCuentaCliente($args) { //verificamos que se haya especificado el id del cliente if (!isset($args['id_cliente'])) { Logger::log("Error al obtener el estado de cuenta, no se ha especificado un cliente."); die('{"success": false, "reason": "Error al obtener el estado de cuenta, no se ha especificado un cliente."}'); } //verificamos que el cliente exista if (!($cliente = ClienteDAO::getByPK($args['id_cliente']))) { Logger::log("Error al obtener el estado de cuenta, no se tiene registro del cliente {$args['id_cliente']}."); die('{"success": false, "reason": "Error al obtener el estado de cuenta, no se tiene registro del cliente ' . $args['id_cliente'] . '"}'); } //obtenemos los datos del emisor $estado_cuenta = estadoCuentaCliente($args); //buscar los datos del emisor if (!($emisor = PosConfigDAO::getByPK('emisor'))) { Logger::log("no encuentro los datos del emisor"); die("no encuentro los datos del emisor"); } $emisor = json_decode($emisor->getValue())->emisor; $sucursal = SucursalDAO::getByPK($_SESSION['sucursal']); if (!$sucursal) { die("Sucursal invalida"); } include_once 'librerias/ezpdf/class.pdf.php'; include_once 'librerias/ezpdf/class.ezpdf.php'; $pdf = new Cezpdf(); $pdf->selectFont('../server/librerias/ezpdf/fonts/Helvetica.afm'); //margenes de un centimetro para toda la pagina $pdf->ezSetMargins(1, 1, 1, 1); /* * LOGO */ if (!($logo = PosConfigDAO::getByPK('url_logo'))) { Logger::log("Verifique la configuracion del pos_config, no se encontro el camṕo 'url_logo'"); die("Verifique la configuracion del POS, no se encontro el url del logo"); } //addJpegFromFile(imgFileName,x,y,w,[h]) //detectamos el tipo de imagen del logo if (substr($logo->getValue(), -3) == "jpg" || substr($logo->getValue(), -3) == "JPG" || substr($logo->getValue(), -4) == "jpeg" || substr($logo->getValue(), -4) == "JPEG") { $pdf->addJpegFromFile($logo->getValue(), puntos_cm(2), puntos_cm(25.5), puntos_cm(3.5)); } elseif (substr($logo->getValue(), -3) == "png" || substr($logo->getValue(), -3) == "PNG") { $pdf->addPngFromFile($logo->getValue(), puntos_cm(2), puntos_cm(25.5), puntos_cm(3.5)); } else { Logger::log("Verifique la configuracion del pos_config, la extension de la imagen del logo no es compatible"); die("La extension de la imagen usada para el logo del negocio no es valida."); } /* * ************************ * ENCABEZADO * ************************* */ $e = "<b>" . self::readableText($emisor->nombre) . "</b>\n"; $e .= formatAddress($emisor); $e .= "RFC: " . $emisor->rfc . "\n\n"; //datos de la sucursal $e .= "<b>Lugar de expedicion</b>\n"; $e .= self::readableText($sucursal->getDescripcion()) . "\n"; $e .= formatAddress($sucursal); $datos = array(array("emisor" => $e)); $pdf->ezSetY(puntos_cm(28.6)); $opciones_tabla = array(); $opciones_tabla['showLines'] = 0; $opciones_tabla['showHeadings'] = 0; $opciones_tabla['shaded'] = 0; $opciones_tabla['fontSize'] = 8; $opciones_tabla['xOrientation'] = 'right'; $opciones_tabla['xPos'] = puntos_cm(7.3); $opciones_tabla['width'] = puntos_cm(11); $opciones_tabla['textCol'] = array(0, 0, 0); $opciones_tabla['titleFontSize'] = 12; $opciones_tabla['rowGap'] = 3; $opciones_tabla['colGap'] = 3; $pdf->ezTable($datos, "", "", $opciones_tabla); $cajero = UsuarioDAO::getByPK($_SESSION['userid'])->getNombre(); $datos = array(array("col" => "<b>Cajero</b>"), array("col" => self::readableText($cajero)), array("col" => "<b>Cliente</b>"), array("col" => self::readableText($cliente->getRazonSocial())), array("col" => "<b>Limite de Credito</b>"), array("col" => FormatMoney($estado_cuenta->limite_credito, DONT_USE_HTML)), array("col" => "<b>Saldo</b>"), array("col" => FormatMoney($estado_cuenta->saldo, DONT_USE_HTML))); $pdf->ezSetY(puntos_cm(28.8)); $opciones_tabla['xPos'] = puntos_cm(12.2); $opciones_tabla['width'] = puntos_cm(6); $opciones_tabla['showLines'] = 0; $opciones_tabla['shaded'] = 2; $opciones_tabla['shadeCol'] = array(1, 1, 1); //$opciones_tabla['shadeCol2'] = array(0.054901961, 0.756862745, 0.196078431); $opciones_tabla['shadeCol2'] = array(0.8984375, 0.95703125, 0.99609375); $pdf->ezTable($datos, "", "", $opciones_tabla); //roundRect($pdf, puntos_cm(12.2), puntos_cm(28.8), puntos_cm(6), puntos_cm(4.25)); /** * ESTADO DE CUENTA */ $elementos = array(array('id_venta' => 'Venta', 'fecha' => 'Fecha', 'sucursal' => 'Sucursal', 'cajero' => 'Cajero', 'tipo_venta' => 'Tipo', 'tipo_pago' => 'Pago', 'total' => 'Total', 'pagado' => 'Pagado', 'saldo' => 'Saldo')); foreach ($estado_cuenta->array_ventas as $venta) { $array_venta = array(); $array_venta['id_venta'] = $venta['id_venta']; $array_venta['fecha'] = $venta['fecha']; $array_venta['sucursal'] = self::readableText($venta['sucursal']); $array_venta['cajero'] = self::readableText($venta['cajero']); $array_venta['cancelada'] = self::readableText($venta['cancelada']); $array_venta['tipo_venta'] = self::readableText($venta['tipo_venta']); $array_venta['tipo_pago'] = self::readableText($venta['tipo_pago']); $array_venta['total'] = FormatMoney($venta['total'], DONT_USE_HTML); $array_venta['pagado'] = FormatMoney($venta['pagado'], DONT_USE_HTML); $array_venta['saldo'] = FormatMoney($venta['saldo'], DONT_USE_HTML); array_push($elementos, $array_venta); } $pdf->ezText("", 8, array('justification' => 'center')); $pdf->ezSetY(puntos_cm(24)); $opciones_tabla['xPos'] = puntos_cm(2); $opciones_tabla['width'] = puntos_cm(16.2); $pdf->ezTable($elementos, "", "Estado de Cuenta", $opciones_tabla); //roundRect($pdf, puntos_cm(2), puntos_cm(24.3), puntos_cm(16.2), puntos_cm(3.2)); /* * ************************ * notas de abajo * ************************* */ $pdf->setLineStyle(1); $pdf->setStrokeColor(0.3359375, 0.578125, 0.89453125); $pdf->line(puntos_cm(2), puntos_cm(1.3), puntos_cm(18.2), puntos_cm(1.3)); $pdf->addText(puntos_cm(2), puntos_cm(1.0), 7, "Fecha de impresion: " . date("d/m/y") . " " . date("H:i:s")); //addJpegFromFile(imgFileName,x,y,w,[h]) //$pdf->addJpegFromFile("../www/media/logo_simbolo.jpg", puntos_cm(15.9), puntos_cm(.25), 25); $pdf->addText(puntos_cm(16.7), puntos_cm(0.6), 8, "caffeina.mx"); $pdf->ezStream(); }
} } } if ($arySwimmer['devices'] != '') { if ($hasnote === FALSE) { $note++; $aryRow['note'] = $note + 1 . ')'; $hasnote = TRUE; $aryNotes[$note] = array('no' => $note + 1 . ')', 'text' => _('Hjælpemidler') . ' ' . $arySwimmer['distance'] . ': ' . $arySwimmer['devices']); } else { $aryNotes[$note]['text'] .= "\n" . _('Hjælpemidler') . ' ' . gettext_dist($arySwimmer['distance']) . ': ' . $arySwimmer['devices']; } } $aryRow[$arySwimmer['distance']] = $arySwimmer['time']; } if (is_array($aryRow)) { $aryData[$cnt] = $aryRow; } $pdf = new Cezpdf(); $pdf->selectFont('./fonts/Helvetica'); $pdf->ezSetY(830); $pdf->ezText(_("Deltagerliste") . " " . $aryCompo['name'] . " - " . date('d-m-Y', strtotime($aryCompo['date'])), 18, array('justification' => 'center')); $pdf->ezSetY(781); $pdf->ezTable($aryData, array('Navn' => _('Navn'), 'Klub' => _('Klub'), '25' => _('25m'), '50' => _('50m'), '100' => _('100m'), 'note' => _('Note')), '', array('xPos' => 57, 'xOrientation' => 'right', 'width' => 481)); // 'Nr'=>'Nr', if ($note >= 0) { $pdf->ezTable($aryNotes, array('no' => '', 'text' => ''), '', array('showHeadings' => 0, 'showLines' => 0, 'shaded' => 0, 'xPos' => 57, 'xOrientation' => 'right', 'width' => 481, 'fontSize' => 10, 'titleFontSize' => 12, 'cols' => array('no' => array('width' => 30, 'justification' => 'center')))); } $pdf->ezStream(); } $db->close();
function dofreePDF() { global $mosConfig_live_site, $mosConfig_sitename, $mosConfig_offset; global $mainframe, $database, $my; $id = intval(mosGetParam($_REQUEST, 'id', 1)); $gid = $my->gid; $now = _CURRENT_SERVER_TIME; $nullDate = $database->getNullDate(); // query to check for state and access levels $query = "SELECT a.*, cc.name AS category, s.name AS section, s.published AS sec_pub, cc.published AS cat_pub," . "\n s.access AS sec_access, cc.access AS cat_access, s.id AS sec_id, cc.id as cat_id" . "\n FROM #__content AS a" . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope = 'content'" . "\n WHERE a.id = " . (int) $id . "\n AND a.state = 1" . "\n AND a.access <= " . (int) $gid . "\n AND ( a.publish_up = " . $database->Quote($nullDate) . " OR a.publish_up <= " . $database->Quote($now) . " )" . "\n AND ( a.publish_down = " . $database->Quote($nullDate) . " OR a.publish_down >= " . $database->Quote($now) . " )"; $database->setQuery($query); $row = NULL; if ($database->loadObject($row)) { /* * check whether category is published */ if (!$row->cat_pub && $row->catid) { mosNotAuth(); return; } /* * check whether section is published */ if (!$row->sec_pub && $row->sectionid) { mosNotAuth(); return; } /* * check whether category access level allows access */ if ($row->cat_access > $gid && $row->catid) { mosNotAuth(); return; } /* * check whether section access level allows access */ if ($row->sec_access > $gid && $row->sectionid) { mosNotAuth(); return; } include 'includes/class.ezpdf.php'; $params = new mosParameters($row->attribs); $params->def('author', !$mainframe->getCfg('hideAuthor')); $params->def('createdate', !$mainframe->getCfg('hideCreateDate')); $params->def('modifydate', !$mainframe->getCfg('hideModifyDate')); $row->fulltext = pdfCleaner($row->fulltext); $row->introtext = pdfCleaner($row->introtext); $pdf = new Cezpdf('a4', 'P'); //A4 Portrait $pdf->ezSetCmMargins(2, 1.5, 1, 1); $pdf->selectFont('./fonts/Helvetica.afm'); //choose font $all = $pdf->openObject(); $pdf->saveState(); $pdf->setStrokeColor(0, 0, 0, 1); // footer $pdf->addText(250, 822, 6, $mosConfig_sitename); $pdf->line(10, 40, 578, 40); $pdf->line(10, 818, 578, 818); $pdf->addText(30, 34, 6, $mosConfig_live_site); $pdf->addText(250, 34, 6, _PDF_POWERED); $pdf->addText(450, 34, 6, _PDF_GENERATED . ' ' . date('j F, Y, H:i', time() + $mosConfig_offset * 60 * 60)); $pdf->restoreState(); $pdf->closeObject(); $pdf->addObject($all, 'all'); $pdf->ezSetDy(30); $txt1 = $row->title; $pdf->ezText($txt1, 14); $txt2 = AuthorDateLine($row, $params); $pdf->ezText($txt2, 8); $txt3 = $row->introtext . "\n" . $row->fulltext; $pdf->ezText($txt3, 10); $pdf->ezStream(); } else { mosNotAuth(); return; } }
} print "</div>"; ?> <script language='JavaScript'> var win = top.printLogPrint ? top : opener.top; win.printLogPrint(window); </script> </div> </body> </html> <?php exit; } else { //print letterhead to pdf $pdf = new Cezpdf(); $pdf->selectFont('Times-Bold'); $pdf->ezSetCmMargins(3, 1, 1, 1); $pdf->ezText($physician_name, 12); $pdf->ezText($practice_address, 12); $pdf->ezText($practice_city . ', ' . $practice_state . ' ' . $practice_zip, 12); $pdf->ezText($practice_phone . ' (' . xl('Voice') . ')', 12); $pdf->ezText($practice_phone . ' (' . xl('Fax') . ')', 12); $pdf->ezText('', 12); $pdf->ezText(date("l, F jS, Y"), 12); $pdf->ezText('', 12); $pdf->selectFont('Helvetica'); $pdf->ezText($content, 10); $pdf->selectFont('Times-Bold'); $pdf->ezText('', 12); $pdf->ezText('', 12); if ($_GET['signer'] == 'patient') {
$ls_conceptoreporte,$ls_codubifis,$ls_codpai,$ls_codest,$ls_codmun,$ls_codpar, $ls_subnomdes,$ls_subnomhas,$ls_orden); // Cargar el DS con los datos de la cabecera del reporte } if(($lb_valido==false) || ($io_report->rs_data->RecordCount()==0)) // Existe algún error ó no hay registros { print("<script language=JavaScript>"); print(" alert('No hay nada que Reportar');"); print(" close();"); print("</script>"); } else // Imprimimos el reporte { error_reporting(E_ALL); set_time_limit(1800); $io_pdf=new Cezpdf('LETTER','portrait'); // Instancia de la clase PDF $io_pdf->selectFont('../../shared/ezpdf/fonts/Helvetica.afm'); // Seleccionamos el tipo de letra $io_pdf->ezSetCmMargins(3,1,1,2); // Configuración de los margenes en centímetros uf_print_encabezado_pagina($ls_titulo,$ls_desnom,$ls_periodo,$io_pdf); // Imprimimos el encabezado de la página $li_totrow=$io_report->rs_data->RecordCount(); $li_i=1; while((!$io_report->rs_data->EOF)&&($lb_valido)) { $li_toting=0; $li_totded=0; $ls_codper=$io_report->rs_data->fields["codper"]; $ls_cedper=$io_report->rs_data->fields["cedper"]; $ls_nomper=$io_report->rs_data->fields["apeper"].", ".$io_report->rs_data->fields["nomper"]; $ls_descar=$io_report->rs_data->fields["descar"]; $ls_codcueban=$io_report->rs_data->fields["codcueban"]; $li_total=$io_report->rs_data->fields["total"]; $ls_unidad=$io_report->rs_data->fields["minorguniadm"].$io_report->rs_data->fields["ofiuniadm"].
<?php header('Content-Type: application/json'); error_reporting(0); require_once 'conexion.php'; require_once '../plugins/ezpdf/Cezpdf.php'; conectarse(); $pdf = new Cezpdf('a4'); $tmp = array('b' => 'Helvetica-Bold', 'i' => 'Courier-Oblique', 'bi' => 'Helvetica-BoldOblique', 'ib' => 'Helvetica-BoldOblique', 'bb' => 'Times-Roman'); $pdf->setFontFamily('Helvetica', $tmp); $pdf->selectFont('fonts/Helvetica.afm'); $pdf->ezSetCmMargins(1.5, 1, 2, 3); $pdf->addJpegFromFile("../img/o.jpg", 50, 750, 100); $folio = trim($_GET['folio']); $result = mysql_query("select folio,fecha,c.nombre_contacto,total,\n\tconcat(nombre,' ',e.apellido_paterno,' ',e.apellido_materno) as nombre \n\tfrom ventas v inner join clientes c on c.matricula = v.cliente \n\tinner join empleados e on e.matricula = v.empleado \n\twhere v.status = 'PAGADA' and folio = '" . $folio . "' "); while ($datatmp = mysql_fetch_array($result)) { $datos = $datatmp['nombre_contacto']; $total = $datatmp['total']; $emp = $datatmp['nombre']; $data[] = array_merge($datatmp, array('folio')); } $options = array('shadeHeadingCol' => array(0.6, 0.6, 0.5), 'shadeCol' => array(0.9, 0.9, 0.9), 'xOrientation' => 'right', 'width' => 70, 'fontSize' => 8, 'xPos' => 480); $titlef = array('folio' => '<b>Folio</b>'); $titles = array('fecha' => '<b>Fecha</b>'); $titlet = array('total' => '<b>Total</b>'); $pdf->ezText("\n", 10); $pdf->ezTable($data, $titlef, '', $options); $pdf->ezText("\n", 10); $pdf->ezTable($data, $titles, '', $options); $pdf->ezText("\n", 10); $pdf->addText(50, 700, 12, "<b>Atendio: </b>\n");
function saldenliste_mv_pdf($monat, $jahr) { ob_clean(); // ausgabepuffer leeren /* PDF AUSGABE */ //include_once ('pdfclass/class.ezpdf.php'); $pdf = new Cezpdf('a4', 'portrait'); $pdf->selectFont('Helvetica.afm'); $pdf->ezSetCmMargins(4.5, 0, 0, 0); /* Kopfzeile */ $pdf->addJpegFromFile('includes/logos/logo_hv_sw.jpg', 220, 750, 175, 100); $pdf->setLineStyle(0.5); $pdf->addText(86, 743, 6, "BERLUS HAUSVERWALTUNG * Fontanestr. 1 * 14193 Berlin * Inhaber Wolfgang Wehrheim * Telefon: 89784477 * Fax: 89784479 * Email: info@berlus.de"); $pdf->line(42, 750, 550, 750); /* Footer */ $pdf->line(42, 50, 550, 50); $pdf->addText(170, 42, 6, "BERLUS HAUSVERWALTUNG * Fontanestr. 1 * 14193 Berlin * Inhaber Wolfgang Wehrheim"); $pdf->addText(150, 35, 6, "Bankverbindung: Dresdner Bank Berlin * BLZ: 100 800 00 * Konto-Nr.: 05 804 000 00 * Steuernummer: 24/582/61188"); $pdf->addInfo('Title', "Saldenliste {$objekt_name} {$monatname} {$jahr}"); $pdf->addInfo('Author', $_SESSION[username]); $pdf->ezStartPageNumbers(550, 755, 7, '', "Seite {PAGENUM} von {TOTALPAGENUM}"); // echo "Monatsbericht Mieter - Monatsbericht Kostenkonten<br>"; // echo "<h3>Aktuelle Mieterstatistik mit ausgezogene Mieter<br></h3>"; $s = new statistik(); $jahr = $_REQUEST[jahr]; if (empty($jahr)) { $jahr = date("Y"); } else { if (strlen($jahr) < 4) { $jahr = date("Y"); } } // $jahr_monat = date("Y-m"); // $jahr = date("Y"); $monat = $_REQUEST[monat]; if (empty($monat)) { $monat = date("m"); } else { if (strlen($monat) < 2) { $monat = '0' . $monat; } } // $monat = '04'; $jahr_monat = $jahr . '-' . $monat; // $jahr_vormonat = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); // $jahr_vormonat = date("Y-m",$jahr_vormonat); $bg = new berlussimo_global(); $link = "?daten=mietvertrag_raus&mietvertrag_raus=saldenliste"; $bg->objekt_auswahl_liste($link); $bg->monate_jahres_links($jahr, $link); if (isset($_SESSION['objekt_id'])) { $objekt_id = $_SESSION['objekt_id']; $einheit_info = new einheit(); $o = new objekt(); $objekt_name = $o->get_objekt_name($objekt_id); $monatname = monat2name($monat); $pdf->addText(70, 755, 10, "Saldenliste {$objekt_name} {$monatname} {$jahr}"); $pdf->ezSetDy(25); $pdf->ezSetCmMargins(3, 3, 3, 3); $text_options = array(left => 0, justification => 'left'); $pdf->ezText("<b>Einheit</b>", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 100, justification => 'left'); $pdf->ezText("<b>Mieter</b>", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 270, justification => 'left'); $pdf->ezText("<b>Einzug</b>", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 320, justification => 'left'); $pdf->ezText("<b>Auszug</b>", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(right => 0, justification => 'right'); $pdf->ezText("<b>SALDO EUR</b>", 8, $text_options); /* Aktuell bzw. gewünschten Monat berechnen */ $ob = new objekt(); $einheiten_array = $ob->einheiten_objekt_arr($objekt_id); // $einheiten_array = $s->vermietete_monat_jahr($jahr_monat,$objekt_id, ''); /* * echo "<pre>"; * print_r($einheiten_array); * echo "<h1> EINHEITEN: $anzahl_aktuell</h1>"; * $mv_array = $einheit_info->get_mietvertrag_ids('7'); * print_r($mv_array); */ $summe_sv = 0; $summe_mieten = 0; $summe_umlagen = 0; $summe_akt_gsoll = 0; $summe_g_zahlungen = 0; $summe_saldo_neu = 0; $anzahl_aktuell = count($einheiten_array); $miete = new miete(); $zeilen_pro_seite = 60; $aktuelle_zeile = 0; for ($i = 0; $i < $anzahl_aktuell; $i++) { $mv_array = $einheit_info->get_mietvertraege_bis("" . $einheiten_array[$i]['EINHEIT_ID'] . "", $jahr, $monat); $mv_anzahl = count($mv_array); if (is_array($mv_array)) { for ($b = 0; $b < $mv_anzahl; $b++) { $mv_id = $mv_array[$b]['MIETVERTRAG_ID']; $mk = new mietkonto(); $mieter_ids = $mk->get_personen_ids_mietvertrag($mv_id); for ($a = 0; $a < count($mieter_ids); $a++) { $mieter_daten_arr[] = $mk->get_person_infos($mieter_ids[$a][PERSON_MIETVERTRAG_PERSON_ID]); } // $miete->mietkonto_berechnung_monatsgenau($mv_id, $jahr, $monat); $end_saldoo = $miete->saldo_berechnen_monatsgenau($mv_id, $monat, $jahr); $zeile = $zeile + 1; $einheit_kurzname = $einheiten_array[$i]['EINHEIT_KURZNAME']; $vn = RTRIM(LTRIM($mieter_daten_arr['0']['0']['PERSON_VORNAME'])); $nn = RTRIM(LTRIM($mieter_daten_arr['0']['0']['PERSON_NACHNAME'])); $akt_gesamt_soll = $miete->saldo_vormonat_stand + $miete->sollmiete_warm; $this->get_mietvertrag_infos_aktuell($mv_id); $l_tag_akt_monat = letzter_tag_im_monat($monat, $jahr); $l_datum = "{$jahr}-{$monat}-{$l_tag_akt_monat}"; if ($this->mietvertrag_bis == '0000-00-00' or $this->mietvertrag_bis > $l_datum) { $mv_bis = 'aktuell'; } else { $mv_bis = date_mysql2german($this->mietvertrag_bis); } $mv_von = date_mysql2german($this->mietvertrag_von); $end_saldoo = nummer_punkt2komma($end_saldoo); if ($mv_bis == 'aktuell') { // echo "$zeile. $einheit_kurzname $nn $vn SALDO NEU: $end_saldoo <br>"; $pdf->ezSetCmMargins(3, 3, 3, 3); $text_options = array(left => 0, justification => 'left'); $pdf->ezText("{$einheit_kurzname}", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 100, justification => 'left'); $pdf->ezText("{$nn} {$vn}", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 270, justification => 'left'); $pdf->ezText("{$mv_von}", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 320, justification => 'left'); $pdf->ezText("", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(right => 0, justification => 'right'); $pdf->ezText("{$end_saldoo}", 8, $text_options); $aktuelle_zeile++; } else { // echo "<b>$zeile. $einheit_kurzname $nn $vn SALDO NEU: $end_saldoo € BEENDET AM :$mv_bis €</b><br>"; $pdf->ezSetCmMargins(3, 3, 3, 3); $text_options = array(left => 0, justification => 'left'); $pdf->ezText("{$einheit_kurzname}", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 100, justification => 'left'); $pdf->ezText("{$nn} {$vn}", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 270, justification => 'left'); $pdf->ezText("{$mv_von}", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 320, justification => 'left'); $pdf->ezText("{$mv_bis}", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(right => 0, justification => 'right'); $pdf->ezText("{$end_saldoo}", 8, $text_options); $aktuelle_zeile++; } if ($zeilen_pro_seite == $aktuelle_zeile) { $pdf->ezNewPage(); /* Kopfzeile */ $pdf->addJpegFromFile('includes/logos/logo_hv_sw.jpg', 220, 750, 175, 100); $pdf->setLineStyle(0.5); $pdf->addText(86, 743, 6, "BERLUS HAUSVERWALTUNG * Fontanestr. 1 * 14193 Berlin * Inhaber Wolfgang Wehrheim * Telefon: 89784477 * Fax: 89784479 * Email: info@berlus.de"); $pdf->line(42, 750, 550, 750); /* Footer */ $pdf->line(42, 50, 550, 50); $pdf->addText(170, 42, 6, "BERLUS HAUSVERWALTUNG * Fontanestr. 1 * 14193 Berlin * Inhaber Wolfgang Wehrheim"); $pdf->addText(150, 35, 6, "Bankverbindung: Dresdner Bank Berlin * BLZ: 100 800 00 * Konto-Nr.: 05 804 000 00 * Steuernummer: 24/582/61188"); $pdf->addInfo('Title', "Saldenliste {$objekt_name} {$monatname} {$jahr}"); $pdf->addText(70, 755, 10, "Saldenliste {$objekt_name} {$monatname} {$jahr}"); $pdf->ezStartPageNumbers(550, 755, 7, '', "Seite {PAGENUM} von {TOTALPAGENUM}"); /* Überschriftzeile */ $pdf->ezSetDy(-18); $pdf->ezSetCmMargins(3, 3, 3, 3); $text_options = array(left => 0, justification => 'left'); $pdf->ezText("<b>Einheit</b>", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 100, justification => 'left'); $pdf->ezText("<b>Mieter</b>", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 270, justification => 'left'); $pdf->ezText("<b>Einzug</b>", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(left => 320, justification => 'left'); $pdf->ezText("<b>Auszug</b>", 8, $text_options); $pdf->ezSetDy(9); $text_options = array(right => 0, justification => 'right'); $pdf->ezText("<b>SALDO EUR</b>", 8, $text_options); $aktuelle_zeile = 0; } unset($mieter_daten_arr); unset($nn); unset($vn); } // end if is_array mv_ids } } // hinweis_ausgeben("Saldenliste mit Vormieter für $objekt_name wurde erstellt<br>"); ob_clean(); // ausgabepuffer leeren $pdf->ezStopPageNumbers(); $pdf->ezStream(); /* Falls kein Objekt ausgewählt */ } else { echo "Objekt auswählen"; } }
// Cargar el DS con los datos de la cabecera del reporte if ($lb_valido == false) { print "<script language=JavaScript>"; print "alert('No hay nada que Reportar');"; print "close();"; print "</script>"; } else { ///////////////////////////////// SEGURIDAD //////////////////////////////////////////////////// $ls_desc_event = "Generó un reporte de Relacion de Bienes Muebles Faltantes. Desde el activo " . $ls_coddesde . " hasta " . $ls_codhasta; $io_fun_activos->uf_load_seguridad_reporte("SAF", "sigesp_saf_r_activo.php", $ls_desc_event); //////////////////////////////// SEGURIDAD ///////////////////////////////////////////////////// error_reporting(E_ALL); set_time_limit(1800); $io_pdf = new Cezpdf('LEGAL', 'landscape'); // Instancia de la clase PDF $io_pdf->selectFont('../../shared/ezpdf/fonts/Helvetica.afm'); // Seleccionamos el tipo de letra $io_pdf->ezSetCmMargins(3.5, 3, 3, 3); // Configuración de los margenes en centímetros $io_pdf->ezStartPageNumbers(940, 50, 10, '', '', 1); // Insertar el número de página uf_print_encabezado_pagina($ls_titulo, "", $ld_fecha, $io_pdf); // Imprimimos el encabezado de la página $li_totrow = $io_report->ds->getRowCount("cmpmov"); $i = 0; for ($li_i = 1; $li_i <= $li_totrow; $li_i++) { $io_pdf->transaction('start'); // Iniciamos la transacción $li_numpag = $io_pdf->ezPageCount; // Número de página $ls_cmpmov = $io_report->ds->data["cmpmov"][$li_i];
<?php include 'class.ezpdf.php'; $pdf = new Cezpdf(); // Set margin dan font $pdf->ezSetCmMargins(3, 3, 3, 3); $pdf->selectFont('fonts/Courier.afm'); $all = $pdf->openObject(); // Tampilkan logo //$pdf->setStrokeColor(0, 0, 0, 1); //$pdf->addJpegFromFile('logo.jpg',20,800,69); // Teks di tengah atas untuk judul header $pdf->addText(30, 820, 16, '<b>KARTU HASIL STUDI</b>'); $pdf->addText(30, 800, 16, '<b>UNIVERSITAS ISLAM NEGERI SUNAN GUNUNG DJATI BANDUNG</b>'); // Garis atas untuk header $pdf->line(10, 795, 578, 795); // Garis bawah untuk footer $pdf->line(10, 50, 578, 50); // Teks kiri bawah $pdf->addText(30, 34, 8, 'Dicetak tgl:' . date('d-m-Y, H:i:s')); $pdf->closeObject(); // Tampilkan object di semua halaman $pdf->addObject($all, 'all'); // Koneksi ke database dan tampilkan datanya include "../../../config/koneksi.php"; // Query untuk merelasikan kedua tabel $nima = $_POST['nim']; $semestera = $_POST['semester']; $tahuna = $_POST['tahun']; $hts = substr($_POST['tahun'], 0, 4); $ktr = $_POST['semester'];
<?php if (@$_REQUEST['action'] == "getpdf") { mysql_connect("localhost", "root", ""); mysql_select_db("cdcol"); include 'Cezpdf.php'; $pdf = new Cezpdf(); $pdf->selectFont('/Applications/XAMPP/xamppfiles/lib/php/fonts/Helvetica.afm'); $pdf->ezText('CD Collection', 14); $pdf->ezText('Copyright 2002-2013 Kai Seidler, oswald@apachefriends.org, GPL', 10); $pdf->ezText('', 12); $result = mysql_query("SELECT id,titel,interpret,jahr FROM cds ORDER BY interpret;"); $i = 0; while ($row = mysql_fetch_array($result)) { $data[$i] = array('interpret' => $row['interpret'], 'titel' => $row['titel'], 'jahr' => $row['jahr']); $i++; } $pdf->ezTable($data, "", "", array('width' => 500)); $pdf->ezStream(); exit; } include "langsettings.php"; ?> <html> <head> <title>apachefriends.org cd collection</title> <link href="xampp.css" rel="stylesheet" type="text/css"> </head> <body>
foreach ($q->loadColumn() as $company) { $total += showcompany($company, true); } } echo '<h2>' . $AppUI->_('Total Hours') . ': '; printf("%.2f", $total); echo '</h2>'; $pdfdata[] = array($AppUI->_('Total Hours'), round($total, 2)); if ($log_pdf) { // make the PDF file $font_dir = W2P_BASE_DIR . '/lib/ezpdf/fonts'; $temp_dir = W2P_BASE_DIR . '/files/temp'; require $AppUI->getLibraryClass('ezpdf/class.ezpdf'); $pdf = new Cezpdf(); $pdf->ezSetCmMargins(1, 2, 1.5, 1.5); $pdf->selectFont($font_dir . '/Helvetica.afm'); $pdf->ezText(w2PgetConfig('company_name'), 12); if ($log_all) { $date = new w2p_Utilities_Date(); $pdf->ezText("\nAll hours as of " . $date->format($df), 8); } else { $sdate = new w2p_Utilities_Date($log_start_date); $edate = new w2p_Utilities_Date($log_end_date); $pdf->ezText("\nHours from " . $sdate->format($df) . ' to ' . $edate->format($df), 8); } $pdf->selectFont($font_dir . '/Helvetica-Bold.afm'); $pdf->ezText("\n" . $AppUI->_('Overall Report'), 12); foreach ($allpdfdata as $company => $data) { $title = $company; $options = array('showLines' => 1, 'showHeadings' => 0, 'fontSize' => 8, 'rowGap' => 2, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => '500', 'cols' => array(0 => array('justification' => 'left', 'width' => 250), 1 => array('justification' => 'right', 'width' => 120))); $pdf->ezTable($data, null, $title, $options);
// the cell padding effect define('PRODUCT_TABLE_LEFT_MARGIN', '2'); // Height of the product listing rectangles define('PRODUCT_TABLE_ROW_HEIGHT', '11'); // The column sizes are where the product listing columns start on the // PDF page, if you make the TABLE HEADER FONT SIZE any larger you will // need to tweak these values to prevent text from clashing together define('PRODUCTS_COLUMN_SIZE', '450'); define('PRODUCT_LISTING_BKGD_COLOR', GREY); define('MODEL_COLUMN_SIZE', '37'); define('PRICING_COLUMN_SIZES', '67'); $vilains = array("à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ", "ß", "'", " ", "à", "á", "ã", "ä", "&Arond;", "è", "æ", "ê", "ë", "ì", "í", "Í", "î", "ï", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú", "û", "ü", "ñ", "ç", "ý", "<", ">", "&"); $cools = array('à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ', 'ß', '\'', ' ', 'à', 'á', 'ã', 'ä', 'å', 'è', 'æ', 'ê', 'ë', 'ì', 'í', 'î', 'Î', 'ï', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ñ', 'ç', 'ý', '<', '>', '&'); $currencies = new currencies(); //$pdf->setPreferences(array("HideToolbar" => 'false', "HideWindowUI" => 'false')); $pdf->selectFont(BATCH_PDF_DIR . 'Helvetica.afm'); $pdf->setFontFamily(BATCH_PDF_DIR . 'Helvetica.afm'); // company name and details pulled from the my store address and phone number // in admin configuration mystore $y = $pdf->ezText(STORE_NAME_ADDRESS, COMPANY_HEADER_FONT_SIZE); $y -= 10; // logo image set to right of the above .. change first number to move sideways //$pdf->addJpegFromFile(BATCH_PRINT_INC . 'templates/' . 'invoicelogo.jpg',365,730,85,85); // extra info boxs to be used by staff $pdf->setStrokeColor(0, 0, 0); $pdf->setLineStyle(0.5); $pdf->Rectangle(300, 745, 250, 70); $pdf->addText(310, 785, GENERAL_FONT_SIZE, TEXT_PACKED_BY); $pdf->addText(310, 760, GENERAL_FONT_SIZE, TEXT_VERIFIED_BY); // line between header order number and order date $pdf->setLineStyle(0.5);
$eliminado = "X"; } $data = array_merge($data, array(array('NUMERO RADICADO' => $radsGrupo[$i], 'FECHA RADICADO' => $rad->getRadi_fech_radi(), 'DESTINATARIO' => $datosRad["nombre"], 'DIRECCION' => $datosRad["direccion"], 'DEPARTAMENTO' => $datosRad["deptoNombre"], 'MUNICIPIO' => $datosRad["muniNombre"], 'ELIMINADO' => $eliminado))); $i++; } } else { $data = array_merge($data, array(array('RESULTADO' => "NO SE ESPECIFICÓ EL GRUPO A RECUPERAR"))); } $retirados = ""; $orientIzq = array("left" => 0); $justCentro = array("justification" => "center"); $estilo1 = array("justification" => "left", "leading" => 8); $estilo2 = array("left" => 0, "leading" => 12); $estilo3 = array("left" => 0, "leading" => 15); $pdf = new Cezpdf("LETTER", "landscape"); $pdf->selectFont("{$ruta_raiz}/include/pdf/fonts/Times-Roman.afm"); $pdf->ezText("RECUPERACION DE LISTADO \n\n", 15, $justCentro); $pdf->ezText("Dependencia: {$dependencia} \n", 12, $estilo1); $pdf->ezText("Usuario Responsable: " . $objUsuario->get_usua_nomb() . " \n", 12, $estilo1); $pdf->ezText("Fecha: {$fechaRadGrupo} \n", 12, $estilo1); $pdf->ezText("\n\n\n ", 6, $estilo1); $pdf->ezTable($data, '', '', array('fontSize' => 6, 'width' => 700)); //Var para almacenar la hora con formato $hora = date("H") . "_" . date("i") . "_" . date("s"); // var que almacena el dia de la fecha $ddate = date('d'); // var que almacena el mes de la fecha $mdate = date('m'); // var que almacena el año de la fecha $adate = date('Y'); // var que almacena la fecha formateada
function acta($argumento) { $fecha_doc = $argumento["fecha_doc"]; $usuarioAutorizaNomb = $argumento["usuarioAutorizaNomb"]; //rint ($query); $pdf = new Cezpdf("LETTER", "portrait"); //LETTER = Carta,portrait = vertical $year = date("Y"); $day = date("d"); $month = date("m"); $a = array("left" => 0); $b = array("justification" => "center"); $d = array("justification" => "left", "leading" => 8); $c = array("left" => 0, "leading" => 12); //leading = espaciado $e = array("left" => 0, "leading" => 15); //leading = espaciado $pdf->ezSetCmMargins(4, 3, 4, 2); //top,botton,left,right /* Se establece la fuente que se utilizara para el texto. */ $pdf->selectFont("../include/pdf/fonts/Times-Roman.afm"); $pdf->ezText("ACTA DE RECUPERACION DE RADICADOS \n\n", 15, $b); //$pdf->ezText($this->query." : \n" ,12,$d); $txtformat = "Radicados recuperados a {$fecha_doc} y autorizados por {$usuarioAutorizaNomb} \n\n "; $pdf->ezText($txtformat, 12, $c); $this->conexion->getResult($this->query); $data = array(); $columna = array(); $contador = 0; while ($this->conexion->cursor->next_record() != 0) { $radicado = $this->conexion->cursor->f('radi_nume_radi'); $columna[$contador++] = $radicado; if ($contador == 4) { $contador = 0; $data = array_merge($data, array(array('-1-' => $columna[0], '-2-' => $columna[1], '-3-' => $columna[2], '-4-' => $columna[3]))); array_splice($columna, 0); } //$data= array_merge ($data,array (array('Número'=>$rucConsecutivo."-".$rucYear,'Usuario'=>$nombre,'Defensor Público'=>$nombreDefensor))); } if ($contador != 0) { $data = array_merge($data, array(array('-1-' => $columna[0], '-2-' => $columna[1], '-3-' => $columna[2], '-4-' => $columna[3]))); } $pdf->ezTable($data); $pdf->ezStream(); }
function init_pdf($pagesize, $orientation, $title) { global $layout; $diff = array(177 => 'aogonek', 161 => 'Aogonek', 230 => 'cacute', 198 => 'Cacute', 234 => 'eogonek', 202 => 'Eogonek', 241 => 'nacute', 209 => 'Nacute', 179 => 'lslash', 163 => 'Lslash', 182 => 'sacute', 166 => 'Sacute', 188 => 'zacute', 172 => 'Zacute', 191 => 'zdot', 175 => 'Zdot', 185 => 'scaron', 169 => 'Scaron', 232 => 'ccaron', 200 => 'Ccaron', 236 => 'edot', 204 => 'Edot', 231 => 'iogonek', 199 => 'Iogonek', 249 => 'uogonek', 217 => 'Uogonek', 254 => 'umacron', 222 => 'Umacron', 190 => 'zcaron', 174 => 'Zcaron'); $pdf = new Cezpdf($pagesize, $orientation); //landscape/portrait $pdf->isUnicode = true; $pdf->addInfo('Producer', 'LMS Developers'); $pdf->addInfo('Title', $title); $pdf->addInfo('Creator', 'LMS ' . $layout['lmsv']); $pdf->setPreferences('FitWindow', '1'); $pdf->ezSetMargins(PDF_MARGIN_TOP, PDF_MARGIN_BOTTOM, PDF_MARGIN_LEFT, PDF_MARGIN_RIGHT); $pdf->setLineStyle(0.5); $pdf->setFontFamily('arial', array('b' => 'arialbd')); $pdf->selectFont('arial', array('encoding' => 'WinAnsiEncoding', 'differences' => $diff), 1, true); return $pdf; }
<?php if ($log_pdf) { // make the PDF file if ($project_id != 0) { $sql = "SELECT project_name FROM projects WHERE project_id={$project_id}"; $pname = db_loadResult($sql); } else { $pname = "All Projects"; } echo db_error(); $font_dir = DP_BASE_DIR . '/lib/ezpdf/fonts'; $temp_dir = (dPgetConfig('overlay_dir') == '' ? DP_BASE_DIR : dPgetConfig('overlay_dir')) . '/files/temp'; require $AppUI->getLibraryClass('ezpdf/class.ezpdf'); $pdf = new Cezpdf(); $pdf->ezSetCmMargins(1, 2, 1.5, 1.5); $pdf->selectFont("{$font_dir}/Helvetica.afm"); $pdf->ezText(safe_utf8_decode(dPgetConfig('company_name')), 12); $date = new CDate(); $pdf->ezText("\n" . $date->format($df), 8); $pdf->selectFont("{$font_dir}/Helvetica-Bold.afm"); $pdf->ezText("\n" . safe_utf8_decode($AppUI->_('Task Log Report')), 12); $pdf->ezText(safe_utf8_decode($pname), 15); if ($log_all) { $pdf->ezText("All task log entries", 9); } else { $pdf->ezText("Task log entries from " . $start_date->format($df) . ' to ' . $end_date->format($df), 9); } $pdf->ezText("\n\n"); $title = 'Task Logs'; $pdfheaders = array(safe_utf8_decode($AppUI->_('Created by')), safe_utf8_decode($AppUI->_('Summary')), safe_utf8_decode($AppUI->_('Description')), safe_utf8_decode($AppUI->_('Date')), safe_utf8_decode($AppUI->_('Hours')), safe_utf8_decode($AppUI->_('Cost Code'))); $options = array('showLines' => 0, 'fontSize' => 12, 'rowGap' => 2, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => 500);
public function pdfObservations($result) { global $loggedUser, $dateformat, $instDir, $objObservation, $objObserver, $objInstrument, $objLocation, $objPresentations, $objObject, $objFilter, $objEyepiece, $objLens; $result = $this->sortResult($result); $pdf = new Cezpdf('a4', 'portrait'); $pdf->ezStartPageNumbers(300, 30, 10); $pdf->selectFont($instDir . 'lib/fonts/Helvetica.afm'); $pdf->ezText(utf8_decode(html_entity_decode($_GET['pdfTitle'])) . "\n"); $i = 0; while (list($key, $value) = each($result)) { if ($i++ > 0) { $pdf->ezNewPage(); } $obs = $objObservation->getAllInfoDsObservation($value['observationid']); $object = $objObject->getAllInfoDsObject($obs['objectname']); if ($loggedUser && $objObserver->getObserverProperty($loggedUser, 'UT')) { $date = sscanf($obs["date"], "%4d%2d%2d"); } else { $date = sscanf($obs["localdate"], "%4d%2d%2d"); } if ($obs['seeing'] > -1) { $seeing = true; } else { $seeing = false; } $formattedDate = date($dateformat, mktime(0, 0, 0, $date[1], $date[2], $date[0])); $temp = array("Name" => html_entity_decode(LangPDFMessage1) . " : " . $obs['objectname'], "altname" => html_entity_decode(LangPDFMessage2) . " : " . $object["altname"], "type" => $GLOBALS[$object['type']] . html_entity_decode(LangPDFMessage12) . $GLOBALS[$object['con']], "visibility" => $obs['visibility'] ? html_entity_decode(LangViewObservationField22) . " : " . $GLOBALS['Visibility' . $obs['visibility']] : '', "seeing" => $seeing ? LangViewObservationField6 . " : " . $GLOBALS['Seeing' . $obs['seeing']] : '', "limmag" => $obs['limmag'] ? LangViewObservationField7 . " : " . $obs['limmag'] : '', "filter" => $obs['filterid'] ? LangViewObservationField31 . " : " . $objFilter->getFilterPropertyFromId($obs['filterid'], 'name') : '', "eyepiece" => $obs['eyepieceid'] ? LangViewObservationField30 . " : " . $objEyepiece->getEyepiecePropertyFromId($obs['eyepieceid'], 'name') : '', "lens" => $obs['lensid'] ? LangViewObservationField32 . " : " . $objLens->getLensPropertyFromId($obs['lensid'], 'name') : '', "observer" => html_entity_decode(LangPDFMessage13) . $objObserver->getObserverProperty($obs['observerid'], 'firstname') . " " . $objObserver->getObserverProperty($obs['observerid'], 'name') . html_entity_decode(LangPDFMessage14) . $formattedDate, "instrument" => html_entity_decode(LangPDFMessage11) . " : " . $objInstrument->getInstrumentPropertyFromId($obs['instrumentid'], 'name'), "location" => html_entity_decode(LangPDFMessage10) . " : " . $objLocation->getLocationPropertyFromId($obs['locationid'], 'name'), "description" => $objPresentations->br2nl(html_entity_decode($obs['description'])), "desc" => html_entity_decode(LangPDFMessage15)); $obs1[] = $temp; $nm = $obs['objectname']; if ($object["altname"]) { $nm = $nm . " (" . $object["altname"] . ")"; } $pdf->ezText($nm, "14"); $tmp = array(array("type" => $temp["type"])); $pdf->ezTable($tmp, array("type" => utf8_decode(html_entity_decode(LangPDFMessage5))), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); $tmp = array(array("location" => $temp["location"], "instrument" => $temp["instrument"])); $pdf->ezTable($tmp, array("location" => utf8_decode(html_entity_decode(LangPDFMessage1)), "instrument" => utf8_decode(html_entity_decode(LangPDFMessage2))), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); $tmp = array(array("eyepiece" => $temp["eyepiece"])); if ($obs['eyepieceid']) { $pdf->ezTable($tmp, array("eyepiece" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("filter" => $temp["filter"])); if ($obs['filterid']) { $pdf->ezTable($tmp, array("filter" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("lens" => $temp["lens"])); if ($obs['lensid']) { $pdf->ezTable($tmp, array("lens" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("seeing" => $temp["seeing"])); if ($seeing) { $pdf->ezTable($tmp, array("seeing" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("limmag" => $temp["limmag"])); if ($obs['limmag']) { $pdf->ezTable($tmp, array("limmag" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("visibility" => $temp["visibility"])); if ($obs['visibility']) { $pdf->ezTable($tmp, array("visibility" => "test"), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); } $tmp = array(array("observer" => $temp["observer"])); $pdf->ezTable($tmp, array("observer" => utf8_decode(html_entity_decode(LangPDFMessage1))), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); $pdf->ezText(utf8_decode(LangPDFMessage15), "12"); $pdf->ezText(""); $tmp = array(array("description" => $temp["description"])); $pdf->ezTable($tmp, array("description" => utf8_decode(html_entity_decode(LangPDFMessage1))), "", array("width" => "500", "showHeadings" => "0", "showLines" => "0", "shaded" => "0")); if ($objObservation->getDsObservationProperty($value['observationid'], 'hasDrawing')) { $pdf->ezText(""); $pdf->ezImage($instDir . "deepsky/drawings/" . $value['observationid'] . ".jpg", 0, 500, "none", "left"); } $pdf->ezText(""); } $pdf->ezStream(); }
{ print("<script language=JavaScript>"); print(" alert('No hay nada que Reportar');"); print(" close();"); print("</script>"); } else // Imprimimos el reporte { ///////////////////////////////// SEGURIDAD ///////////////////////////////////////////////////// $ls_desc_event="Se Genero el Reporte Acta de Recepcion de Bienes con orden de compra ".$ls_numordcom." "; $io_fun_inventario->uf_load_seguridad_reporte("SIV","sigesp_siv_r_acta_recepcion_bienes.php",$ls_desc_event); //////////////////////////////// SEGURIDAD ////////////////////////////////////////////////////// error_reporting(E_ALL); set_time_limit(1800); $io_pdf=new Cezpdf('LETTER','portrait'); // Instancia de la clase PDF $io_pdf->selectFont('../../shared/ezpdf/fonts/Times-Roman.afm'); // Seleccionamos el tipo de letra $io_pdf->ezSetCmMargins(3.5,3,3,3); // Configuraci�n de los margenes en cent�metros uf_print_encabezado_pagina($ls_titulo,$io_pdf); // Imprimimos el encabezado de la p�gina $io_pdf->ezStartPageNumbers(550,740,10,'','',1); // Insertar el n�mero de p�gina $li_totrow_det=$io_report->dts_reporte->getRowCount("numordcom"); $ld_total=0; for($li_s=1;$li_s<=$li_totrow_det;$li_s++) { $li_contador=$li_s; $ls_numordcom=$io_report->dts_reporte->data["numordcom"][$li_s]; $ls_cod_pro=$io_report->dts_reporte->data["cod_pro"][$li_s]; $ls_codalm=$io_report->dts_reporte->data["codalm"][$li_s]; $ls_nomresalm=$io_report->dts_reporte->data["nomresalm"][$li_s]; $ls_codart=$io_report->dts_reporte->data["codart"][$li_s]; $ls_canart=$io_report->dts_reporte->data["canart"][$li_s]; $ls_preuniart=number_format($io_report->dts_reporte->data["preuniart"][$li_s],2,",",".");
$scoredisplay = ScoreDisplay::instance(); $scorecourse = $category[0]->calc_score($user_id); $scorecourse_display = isset($scorecourse) ? $scoredisplay->display_score($scorecourse, SCORE_AVERAGE) : get_lang('NoResultsAvailable'); $cattotal = Category::load(0); $scoretotal = $cattotal[0]->calc_score($user_id); $scoretotal_display = isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable'); //prepare all necessary variables: $organization_name = api_get_setting('Institution'); $portal_name = api_get_setting('siteName'); $stud_fn = $user['firstname']; $stud_ln = $user['lastname']; $certif_text = sprintf(get_lang('CertificateWCertifiesStudentXFinishedCourseYWithGradeZ'), $organization_name, $stud_fn . ' ' . $stud_ln, $category[0]->get_name(), $scorecourse_display); $certif_text = str_replace("\\n", "\n", $certif_text); $date = api_convert_and_format_date(null, DATE_FORMAT_SHORT); $pdf = new Cezpdf('a4', 'landscape'); $pdf->selectFont(api_get_path(LIBRARY_PATH) . 'ezpdf/fonts/Courier.afm'); $pdf->ezSetMargins(30, 30, 50, 50); //line Y coordinates in landscape mode are upside down (500 is on top, 10 is on the bottom) $pdf->line(50, 50, 790, 50); $pdf->line(50, 550, 790, 550); $pdf->ezSetY(450); //@todo replace image //$pdf->ezImage(api_get_path(SYS_CODE_PATH).'img/dokeos_logo_certif.png',1,400,'','center',''); $pdf->ezSetY(480); $pdf->ezText($certif_text, 28, array('justification' => 'center')); //$pdf->ezSetY(750); $pdf->ezSetY(50); $pdf->ezText($date, 18, array('justification' => 'center')); $pdf->ezSetY(580); $pdf->ezText($organization_name, 22, array('justification' => 'left')); $pdf->ezSetY(580);
function _print_prescription_old($p, &$toFile) { $pdf = new Cezpdf($GLOBALS['rx_paper_size']); $pdf->ezSetMargins($GLOBALS['rx_top_margin'], $GLOBALS['rx_bottom_margin'], $GLOBALS['rx_left_margin'], $GLOBALS['rx_right_margin']); $pdf->selectFont('Helvetica'); if (!empty($this->pconfig['logo'])) { $pdf->ezImage($this->pconfig['logo'], "", "", "none", "left"); } $pdf->ezText($p->get_prescription_display(), 10); if ($this->pconfig['use_signature']) { $pdf->ezImage($this->pconfig['signature'], "", "", "none", "left"); } else { $pdf->ezText("\n\n\n\nSignature:________________________________", 10); } if (!empty($toFile)) { $toFile = $pdf->ezOutput(); } else { $pdf->ezStream(); // $pdf->ezStream(array('compress' => 0)); // for testing with uncompressed output } return; }