本文整理汇总了PHP中Cezpdf::setStrokeColor方法的典型用法代码示例。如果您正苦于以下问题:PHP Cezpdf::setStrokeColor方法的具体用法?PHP Cezpdf::setStrokeColor怎么用?PHP Cezpdf::setStrokeColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cezpdf
的用法示例。
在下文中一共展示了Cezpdf::setStrokeColor方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
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);
$pdf->line(LEFT_MARGIN, $y, LINE_LENGTH, $y);
$pdf->ezSetY($y);
$dup_y = $y;
// order number
$y = $pdf->ezText("<b>" . TEXT_ORDER_NUMBER . " </b>" . $orders['orders_prefix'] . $orders['orders_id'] . "\n\n", SUB_HEADING_FONT_SIZE);
// order date
if ($_POST['show_order_date']) {
$pdf->ezSetY($dup_y);
$pdf->ezText("<b>" . TEXT_ORDER_DATE . " </b>" . date(TEXT_ORDER_FORMAT, strtotime($order->info['date_purchased'])) . "\n\n", SUB_HEADING_FONT_SIZE, array('justification' => 'right'));
示例2: dofreePDF
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;
}
}
示例3: imprimirEstadoCuentaCliente
//.........这里部分代码省略.........
$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();
}
示例4: array
/**
* Creates a PDF document and sends this pricelist to the client
*
* Unfortunately, ezpdf does not return anything after printing the
* document, so there's no way to tell whether it has succeeded.
* Thus, you should not rely on the return value, except when it is
* false -- in that case, loading of some data failed.
* @return boolean False on failure, true on supposed success
*/
function send_as_pdf()
{
global $objInit, $_ARRAYLANG;
if (!$this->load()) {
return \Message::error($_ARRAYLANG['TXT_SHOP_PRICELIST_ERROR_LOADING']);
}
$objPdf = new \Cezpdf('A4');
$objPdf->setEncryption('', '', array('print'));
$objPdf->selectFont(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseLibraryPath() . '/ezpdf/fonts/' . $this->font);
$objPdf->ezSetMargins(0, 0, 0, 0);
// Reset margins
$objPdf->setLineStyle(0.5);
$marginTop = 30;
$biggerCountTop = $biggerCountBottom = 0;
$arrHeaderLeft = $arrHeaderRight = $arrFooterLeft = $arrFooterRight = array();
if ($this->header) {
// header should be shown
$arrHeaderLeft = explode("\n", $this->header_left);
$arrHeaderRight = explode("\n", $this->header_right);
$countLeft = count($arrHeaderLeft);
$countRight = count($arrHeaderRight);
$biggerCountTop = $countLeft > $countRight ? $countLeft : $countRight;
$marginTop = $biggerCountTop * 14 + 36;
}
// Bottom margin
$marginBottom = 20;
$arrFooterRight = array();
if ($this->footer) {
// footer should be shown
// Old, obsolete:
$this->footer_left = str_replace('<--DATE-->', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_left);
$this->footer_right = str_replace('<--DATE-->', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_right);
// New:
$this->footer_left = str_replace('[DATE]', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_left);
$this->footer_right = str_replace('[DATE]', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_right);
$arrFooterLeft = explode("\n", $this->footer_left);
$arrFooterRight = explode("\n", $this->footer_right);
$countLeft = count($arrFooterLeft);
$countRight = count($arrFooterRight);
$biggerCountBottom = $countLeft > $countRight ? $countLeft : $countRight;
$marginBottom = $biggerCountBottom * 20 + 20;
}
// Borders
if ($this->border) {
$linesForAllPages = $objPdf->openObject();
$objPdf->saveState();
$objPdf->setStrokeColor(0, 0, 0, 1);
$objPdf->rectangle(10, 10, 575.28, 821.89);
$objPdf->restoreState();
$objPdf->closeObject();
$objPdf->addObject($linesForAllPages, 'all');
}
// Header
$headerArray = array();
$startpointY = 0;
if ($this->header) {
$objPdf->ezSetY(830);
$headerForAllPages = $objPdf->openObject();
$objPdf->saveState();
for ($i = 0; $i < $biggerCountTop; ++$i) {
$headerArray[$i] = array('left' => isset($arrHeaderLeft[$i]) ? $arrHeaderLeft[$i] : '', 'right' => isset($arrHeaderRight[$i]) ? $arrHeaderRight[$i] : '');
}
$tempY = $objPdf->ezTable($headerArray, '', '', array('showHeadings' => 0, 'fontSize' => $this->font_size_header, 'shaded' => 0, 'width' => 540, 'showLines' => 0, 'xPos' => 'center', 'xOrientation' => 'center', 'cols' => array('right' => array('justification' => 'right'))));
$tempY -= 5;
if ($this->border) {
$objPdf->setStrokeColor(0, 0, 0);
$objPdf->line(10, $tempY, 585.28, $tempY);
}
$startpointY = $tempY - 5;
$objPdf->restoreState();
$objPdf->closeObject();
$objPdf->addObject($headerForAllPages, 'all');
}
// Footer
$pageNumbersX = $pageNumbersY = $pageNumbersFont = 0;
if ($this->footer) {
$footerForAllPages = $objPdf->openObject();
$objPdf->saveState();
$tempY = $marginBottom - 5;
if ($this->border) {
$objPdf->setStrokeColor(0, 0, 0);
$objPdf->line(10, $tempY, 585.28, $tempY);
}
// length of the longest word
$longestWord = 0;
foreach ($arrFooterRight as $line) {
if ($longestWord < strlen($line)) {
$longestWord = strlen($line);
}
}
for ($i = $biggerCountBottom - 1; $i >= 0; --$i) {
//.........这里部分代码省略.........
示例5: pdfLaudos
/**
* gera um pdf dos laudos
*
* @param array $r
*/
function pdfLaudos($rs){
//error_reporting(E_ALL);
set_time_limit(1800);
include 'lib/php/classes/class.ezpdf.php';
$pdf = new Cezpdf('a4','portrait');
$pdf -> ezSetMargins(50,70,50,50);
$all = $pdf->openObject();
$pdf->saveState();
$pdf->setStrokeColor(0,0,0,1);
$pdf->restoreState();
$pdf->closeObject();
$pdf->addObject($all,'all');
$mainFont = './fonts/Courier.afm';
$codeFont = './fonts/Courier.afm';
$pdf->selectFont($mainFont);
$n_rows = sizeof($rs);
$c = 0;
$t=945;
$fator = 25;
foreach($rs as $id => $r){
$o = new Interpretacao($r["int_id"]);
$hos = new Hospital($o->get("hos_id"));
$hos_nome = $hos->get("hos_nome");
$con = new Convenio($o->get("con_id"));
$con_nome = $con->get("con_nome");
$exa = new Exame($o->get("exa_id"));
$exa_nome = $exa->get("exa_nome");
$pdf->ezText($hos_nome,18,array('justification'=>'center'));
$pdf->ezText(" ",20,array('justification'=>'left'));
$pdf->ezText("PACIENTE : ".$r["int_paciente_prontuario"]." ".$r["int_paciente_nome"],10,array('justification'=>'left'));
if ($r["int_paciente_nascimento"] == "0000-00-00")
$pdf->ezText("NASCIMENTO : SEXO: ".$r["int_paciente_sexo"],10,array('justification'=>'left'));
else
$pdf->ezText("NASCIMENTO : ".Formatacao::formatBrData($r["int_paciente_nascimento"])." SEXO: ".$r["int_paciente_sexo"],10,array('justification'=>'left'));
$pdf->ezText("CONVÊNIO : ".$con_nome,10,array('justification'=>'left'));
$pdf->ezText("EXAME : ".$exa_nome,10,array('justification'=>'left'));
$pdf->ezText(" ",20,array('justification'=>'left'));
$pdf->ezText(" DATA: ".Formatacao::formatBrDataHoraminSeg($r["int_data_interpretacao"]),10,array('justification'=>'left'));
$pdf->ezText("N DO EXAME : ".$r["int_opcional"],10,array('justification'=>'left'));
$pdf->ezText("MÉDICO REQUISITANTE : ".$r["int_requisitante"],10,array('justification'=>'left'));
$pdf->ezText("EXAME INTERPRETADO POR : 9679 Ernesto Sousa Nunes",10,array('justification'=>'left'));
$pdf->ezText("TÉCNICO RX : ".$r["int_tecnico_rx"],10,array('justification'=>'left'));
$pdf->ezText(" ",20,array('justification'=>'left'));
$pdf->ezText("I N T E R P R E T A Ç Ã O",18,array('justification'=>'center'));
$pdf->ezText(" ",20,array('justification'=>'left'));
$vet_txt = split("\n",$r["int_texto"]);
$pdf->ezText("============================================================================",10,array('justification'=>'left'));
$pdf->ezText(" ",8,array('justification'=>'left'));
foreach($vet_txt as $linha){
$pdf->ezText(" ".$linha,10,array('justification'=>'left'));
}
$pdf->ezText(" ",8,array('justification'=>'left'));
$pdf->ezText("============================================================================",10,array('justification'=>'left'));
$pdf->ezText(" Exame interpretado por: 9676 - Dr. Ernesto Sousa Nunes",10,array('justification'=>'left'));
$pdf->addJpegFromFile('ass.jpg',250, 0);
$pdf->openHere('Fit');
if ($c+1 < $n_rows)
$pdf->ezNewPage();
$c++;
$o->informaImpressao();
//$sql = "update laudo set LAU_DATA_EXPORTACAO = now() where LAU_ID = ".$r["LAU_ID"]." LIMIT 1";
//$up = mysql_query($sql, $db) or die(mysql_error());
}
$pdfcode = $pdf->Output();
//$pdfcode = str_replace("\n","\n<br>",htmlspecialchars($pdfcode));
//$cont = trim($pdfcode);
$fh = fopen("laudos_prontos.pdf", 'w+');
fwrite($fh, $pdfcode);
fclose($fh);
?><script language="javascript">document.location.href="laudos_prontos.pdf";</script><?
}
示例6: creaPDF
function creaPDF($colname_factura, $tmpName)
{
global $database_f4, $f4, $interface, $setsProlec, $url_dir;
$FWK_PDFFONTS = 'pdf/fonts/';
$FWK_PDFDEFAULTFONT = '/face5/' . $url_dir . '/f4/extensiones/pdf/fonts/Helvetica.afm';
$FWK_PDFCOURIERFONT = 'pdf/fonts/Courier.afm';
// Obtener factura y sus anexos
$TIPOSCOMPROBANTEMXP = array(1 => "Factura", 3 => "Nota de Cr.", 2 => "NOTA DE DEBITO");
mysql_select_db($database_f4, $f4);
$query_factura = sprintf("SELECT facturas.idfactura, facturas.idempresa, facturas.idsello,\n\tfacturas.serie, facturas.folio, archivo,\n\tdate_format( facturas.timestampemision, '%%d/%%m/%%Y %%T') as timestampemision,\n\tfacturas.noaprob, facturas.rfccliente, facturas.estatus, facturas.sello, facturas.cadena, facturas.factura,\n\tfacturas.idif, facturas.tipocfd, empresa.bu\n\tFROM facturas inner join empresa on (facturas.idempresa=empresa.idempresa)\n\tWHERE facturas.idfactura = %s", $colname_factura);
$factura = mysql_query($query_factura, $f4);
$row_factura = mysql_fetch_assoc($factura);
$totalRows_factura = mysql_num_rows($factura);
print_r($row_factura);
mysql_select_db($database_f4, $f4);
$query_partida = sprintf("SELECT * FROM face_partidas WHERE face_factura_idface_factura = %s ORDER BY numero ASC", $row_factura['idif']);
$partidas = mysql_query($query_partida, $f4);
$partidasArray = array();
while ($partRow = mysql_fetch_assoc($partidas)) {
array_push($partidasArray, $partRow);
}
$dom = new DOMDocument();
$dom->loadXML(base64_decode($row_factura['factura']));
$NS = "http://www.sat.gob.mx/cfd/2";
$NSP = "";
$xp = new DOMXPath($dom);
$nsElems = $dom->getElementsByTagNameNS($NS, 'Comprobante');
if ($nsElems->item(0) != null) {
$xp->registerNamespace("C", "http://www.sat.gob.mx/cfd/2");
$NSP = "C:";
}
$comprobanteNode = null;
$elements = $xp->query("/" . $NSP . "Comprobante");
foreach ($elements as $comprobanteNode) {
}
$emisorNode = null;
$elements = $xp->query("/" . $NSP . "Comprobante/" . $NSP . "Emisor");
foreach ($elements as $emisorNode) {
}
$emisordomicilioNode = null;
$elements = $xp->query("/" . $NSP . "Comprobante/" . $NSP . "Emisor/" . $NSP . "DomicilioFiscal");
foreach ($elements as $emisordomicilioNode) {
}
$expedidoNode = null;
$elements = $xp->query("/" . $NSP . "Comprobante/" . $NSP . "Emisor/" . $NSP . "ExpedidoEn");
foreach ($elements as $expedidoNode) {
}
$receptorNode = null;
$elements = $xp->query("/" . $NSP . "Comprobante/" . $NSP . "Receptor");
foreach ($elements as $receptorNode) {
}
$receptordomicilioNode = null;
$elements = $xp->query("/" . $NSP . "Comprobante/" . $NSP . "Receptor/" . $NSP . "Domicilio");
foreach ($elements as $receptordomicilioNode) {
}
$conceptoNode = null;
$conceptos = $xp->query("/" . $NSP . "Comprobante/" . $NSP . "Conceptos/" . $NSP . "Concepto");
$impuestosNode = null;
$elements = $xp->query("/" . $NSP . "Comprobante/" . $NSP . "Impuestos");
foreach ($elements as $impuestosNode) {
}
$trasladoNode = null;
$traslados = $xp->query("/" . $NSP . "Comprobante/" . $NSP . "Impuestos/" . $NSP . "Traslados/" . $NSP . "Traslado");
$retencionNode = null;
$retenciones = $xp->query("/" . $NSP . "Comprobante/" . $NSP . "Impuestos/" . $NSP . "Retenciones/" . $NSP . "Retencion");
mysql_select_db($database_f4, $f4);
$query_empresa = sprintf("SELECT * FROM empresa WHERE idempresa = %s", $row_factura['idempresa']);
$empresa = mysql_query($query_empresa, $f4);
$row_empresa = mysql_fetch_assoc($empresa);
mysql_select_db($database_f4, $f4);
$query_sello = sprintf("SELECT * FROM sellos WHERE idsello = %s", $row_factura['idsello']);
$sello = mysql_query($query_sello, $f4);
$row_sello = mysql_fetch_assoc($sello);
mysql_select_db($database_f4, $f4);
$query_sucursal = "SELECT * FROM sucursales WHERE sucursal = '" . $row_sello['sucursal'] . "'";
$sucursal = mysql_query($query_sucursal, $f4);
$row_sucursal = mysql_fetch_assoc($sucursal);
$totalRows_sucursal = mysql_num_rows($sucursal);
//descuentos
$desc1 = 0.0;
$desc2 = 0.0;
//==================================================================================================================
// Crea el documento pdf
$pdf = new Cezpdf('LETTER', 'portrait');
//'LETTER' (612.00,792.00)
$pdf->ezSetMargins(100, 30, 30, 30);
//$pdf->selectFont($FWK_PDFDEFAULTFONT);
$pdf->setLineStyle(0.7, '', '', '', 0);
$pdf->openHere('Fit');
if ($row_factura['tipocfd'] == 3) {
$pdf->setStrokeColor(255, 0, 0);
}
if ($row_factura['tipocfd'] == 2) {
$pdf->setStrokeColor(0, 255, 0);
}
// Inicia numeracin de páginas.
$pdf->ezStartPageNumbers(400, 50, 10, 'left', '{PAGENUM} of {TOTALPAGENUM}', 1);
$pagina = 1;
$primeraPagina = $pdf->currentPage;
// i. Agrega el logo de la empresa
//.........这里部分代码省略.........
示例7: citeRecords
function citeRecords($result, $rowsFound, $query, $queryURL, $showQuery, $showLinks, $rowOffset, $showRows, $previousOffset, $nextOffset, $wrapResults, $citeStyle, $citeOrder, $citeType, $orderBy, $headerMsg, $userID, $viewType)
{
global $officialDatabaseName;
// these variables are defined in 'ini.inc.php'
global $databaseBaseURL;
global $contentTypeCharset;
global $pdfPageSize;
global $client;
// The array '$transtab_refbase_pdf' contains search & replace patterns for conversion from refbase markup to PDf markup & entities
global $transtab_refbase_pdf;
// defined in 'transtab_refbase_pdf.inc.php'
// Initialize array variables:
$yearsArray = array();
$typeTitlesArray = array();
// Define inline text markup to be used by the 'citeRecord()' function:
$markupPatternsArray = array("bold-prefix" => "<b>", "bold-suffix" => "</b>", "italic-prefix" => "<i>", "italic-suffix" => "</i>", "underline-prefix" => "<u>", "underline-suffix" => "</u>", "endash" => "¦", "emdash" => "©", "ampersand" => "&", "double-quote" => '"', "double-quote-left" => "ª", "double-quote-right" => "¬", "single-quote" => "'", "single-quote-left" => "®", "single-quote-right" => "¶", "less-than" => "<", "greater-than" => ">", "newline" => "\n");
// Defines search & replace 'actions' that will be applied upon PDF output to all those refbase fields that are listed
// in the corresponding 'fields' element:
$pdfSearchReplaceActionsArray = array(array('fields' => array("title", "publication", "abbrev_journal", "address", "keywords", "abstract", "orig_title", "series_title", "abbrev_series_title", "notes"), 'actions' => $transtab_refbase_pdf));
// For CLI queries, we'll allow paging thru the result set, i.e. we honour the values of the CLI options '-S|--start' ('$rowOffset')
// and '-R|--rows' ('$showRows') ('$rowOffset' and '$showRows' are re-assigned in function 'seekInMySQLResultsToOffset()' in 'include.inc.php')
if (preg_match("/^cli/i", $client)) {
// if the query originated from a command line client such as the "refbase" CLI client ("cli-refbase-1.0")
$showMaxRows = $showRows;
} else {
$showMaxRows = $rowsFound;
}
// otherwise show all rows
// Setup the basic PDF document structure (PDF functions defined in 'class.ezpdf.php'):
$pdf = new Cezpdf($pdfPageSize, 'portrait');
// initialize PDF object
if (!empty($headerMsg)) {
// adjust upper page margin if a custom header message was given
$pageMarginTop = "70";
} else {
$pageMarginTop = "50";
}
$pdf->ezSetMargins($pageMarginTop, 70, 50, 50);
// set document margins (top, bottom, left, right)
// Set fonts:
$headingFont = 'includes/classes/org/pdf-php/fonts/Helvetica.afm';
$textBodyFont = 'includes/classes/org/pdf-php/fonts/Times-Roman.afm';
// Re-map character numbers from the 0->255 range to a named character, i.e. replace an (unused) character for any other PostScript char;
// see the PDF reference for a list of supported PostScript/PDF character names: <http://www.adobe.com/devnet/pdf/pdf_reference.html>;
// for the decimal code numbers of the ISO-8859-1 character set, see e.g.: <http://www.ramsch.org/martin/uni/fmi-hp/iso8859-1.html>
$diff = array(166 => 'endash', 169 => 'emdash', 170 => 'quotedblleft', 172 => 'quotedblright', 174 => 'quoteleft', 182 => 'quoteright');
// Select a font:
$pdf->selectFont($textBodyFont, array('encoding' => 'WinAnsiEncoding', 'differences' => $diff));
$pdf->openHere('Fit');
// Put a footer (and optionally a header) on all the pages:
$all = $pdf->openObject();
// start an independent object; all further writes to a page will actually go into this object, until a 'closeObject()' call is made
$pdf->saveState();
$pdf->setStrokeColor(0, 0, 0, 1);
// set line color
$pdf->setLineStyle(0.5);
// set line width
// - print header line and header message at the specified x/y position:
if (!empty($headerMsg)) {
// Remove any colon (":") from end of header message:
$headerMsg = trimTextPattern($headerMsg, ":", false, true);
// function 'trimTextPattern()' is defined in 'include.inc.php'
// Decode any HTML entities:
// (these may occur in the header message e.g. if the user's preferred display language is not English but German or French, etc)
$headerMsg = decodeHTML($contentTypeCharset, $headerMsg);
// function 'decodeHTML()' is defined in 'include.inc.php', and '$contentTypeCharset' is defined in 'ini.inc.php'
// Convert refbase markup in the header message into appropriate PDF markup & entities:
$headerMsg = searchReplaceText($transtab_refbase_pdf, $headerMsg, true);
// function 'searchReplaceText()' is defined in 'include.inc.php'
if ($pdfPageSize == 'a4') {
$pdf->line(20, 800, 575, 800);
$pdf->addText(50, 805, 10, $headerMsg);
} elseif ($pdfPageSize == 'letter') {
$pdf->line(20, 750, 592, 750);
$pdf->addText(50, 755, 10, $headerMsg);
}
}
// - print footer line and footer text at the specified x/y position:
if ($pdfPageSize == 'a4') {
$pdf->line(20, 40, 575, 40);
$pdf->addText(50, 28, 10, $officialDatabaseName . ' ¦ ' . $databaseBaseURL);
// w.r.t. the endash, see notes at '$markupPatternsArray' and '$diff' above
} elseif ($pdfPageSize == 'letter') {
$pdf->line(20, 40, 592, 40);
$pdf->addText(50, 28, 10, $officialDatabaseName . ' ¦ ' . $databaseBaseURL);
}
$pdf->restoreState();
$pdf->closeObject();
// close the currently open object; further writes will now go to the current page
$pdf->addObject($all, 'all');
// note that object can be told to appear on just odd or even pages by changing 'all' to 'odd' or 'even'
// Start printing page numbers:
if ($pdfPageSize == 'a4') {
$pdf->ezStartPageNumbers(550, 28, 10, '', '', 1);
} elseif ($pdfPageSize == 'letter') {
$pdf->ezStartPageNumbers(567, 28, 10, '', '', 1);
}
// LOOP OVER EACH RECORD:
// Fetch one page of results (or less if on the last page)
// (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ...
//.........这里部分代码省略.........
示例8: creaPDF
function creaPDF($ids, $tmpName, $path, $PATHQR, $tmp = "")
{
require dirname(dirname(dirname(__FILE__))) . '/f4/configuracion/utils.php';
require dirname(dirname(dirname(__FILE__))) . '/f4/configuracion/importeco.php';
require dirname(dirname(dirname(__FILE__))) . "/gui/QRCode/qr_imgV2.php";
$data = "";
$facturaController = new FacturaController($path);
$selloController = new SelloController($path);
$empresaController = new EmpresaController($path);
$sucursalController = new SucursalController($path);
$FWK_PDFFONTS = 'pdf/fonts/';
$FWK_PDFDEFAULTFONT = 'pdf/fonts/Helvetica.afm';
$FWK_PDFCOURIERFONT = 'pdf/fonts/Courier.afm';
// Obtener factura y sus anexos
$TIPOSCOMPROBANTEMXP = array(1 => "Factura", 3 => "Nota de Cr.", 2 => "NOTA DE DEBITO");
$idconsulta = "";
$idconsulta = explode(",", trim($ids));
foreach ($idconsulta as $valor) {
if (is_null($valor) || $valor == "") {
array_pop($idconsulta);
}
}
$contadorTotalPaginas = count($idconsulta);
$contadorPagina = 1;
// Crea el documento pdf
$pdf = new Cezpdf('LETTER', 'portrait');
foreach ($idconsulta as $idfactura) {
$data['idfactura'] = $idfactura;
$factura = $facturaController->execute('facturaParaPdf', $data);
$row_factura = $factura['respuesta'];
$info_xtra = json_decode($row_factura["info_xtra"]);
$data['idfacefactura'] = $factura['respuesta']['idface_factura'];
$data['idempresa'] = $factura['respuesta']['idempresa'];
$data['idsello'] = $factura['respuesta']['idsello'];
$version = $factura['respuesta']['version'];
$addenda = $facturaController->execute('datosAddenda', $data);
$row_addenda = $addenda['respuesta'];
$empresa = $empresaController->execute('allId', $data);
$row_empresa = $empresa['respuesta'];
$sello = $selloController->execute('obtenerPorIdsello', $data);
$row_sello = $sello['respuesta'];
$data['sucursal'] = $sello['respuesta']['sucursal'];
$sucursal = $sucursalController->execute('nombreSucIdempresa', $data);
$row_sucursal = $sucursal['respuesta'];
$xmlArray = xml2array(base64_decode($row_factura['factura']));
$attr = "_attr";
if ($version === "3.2") {
$NSP = "cfdi:";
} else {
$NSP = "";
}
$comprobante = $NSP . "Comprobante";
$emisor = $NSP . "Emisor";
$emisorDomFiscal = $NSP . "DomicilioFiscal";
$emisorExpedidoEn = $NSP . "ExpedidoEn";
$receptor = $NSP . "Receptor";
$domicilio = $NSP . "Domicilio";
$concepto = $NSP . "Conceptos";
$conceptoTag = $NSP . "Concepto";
$impuestos = $NSP . "Impuestos";
$traslado = $NSP . "Traslados";
$trasladoTag = $NSP . "Traslado";
$retencion = $NSP . "Retenciones";
$retencionTag = $NSP . "Retencion";
//INICIALIZACIONES
$comprobanteNode = null;
$emisorNode = null;
$emisordomicilioNode = null;
$expedidoNode = null;
$receptorNode = null;
$receptordomicilioNode = null;
$conceptoNode = null;
$impuestosNode = null;
$trasladoNode = null;
$retencionNode = null;
// -------------------------------------------------chs --------------------------------------------------------------
$comprobanteNode = $xmlArray[$comprobante . $attr];
$emisorNode = $xmlArray[$comprobante][$emisor . $attr];
$emisordomicilioNode = $xmlArray[$comprobante][$emisor][$emisorDomFiscal . $attr];
$expedidoNode = isset($xmlArray[$comprobante][$emisor][$emisorExpedidoEn . $attr]) ? $xmlArray[$comprobante][$emisor][$emisorExpedidoEn . $attr] : "";
$receptorNode = $xmlArray[$comprobante][$receptor . $attr];
$receptordomicilioNode = $xmlArray[$comprobante][$receptor][$domicilio . $attr];
$conceptos = $xmlArray[$comprobante][$concepto];
$impuestosNode = $xmlArray[$comprobante][$impuestos . $attr];
$traslados = $xmlArray[$comprobante][$impuestos][$traslado];
$retenciones = isset($xmlArray[$comprobante][$impuestos][$retencion][$retencionTag . $attr]) ? $xmlArray[$comprobante][$impuestos][$retencion][$retencionTag . $attr] : "";
$regimenFiscal = $xmlArray[$comprobante][$emisor]["cfdi:RegimenFiscal_attr"]["Regimen"];
// ---------------------------------------------------------------------------------------------------------------
//descuentos
$desc1 = 0.0;
$desc2 = 0.0;
//==================================================================================================================
$pdf->ezSetMargins(100, 30, 30, 30);
$pdf->selectFont($FWK_PDFDEFAULTFONT);
$pdf->setLineStyle(0.7, '', '', '', 0);
$pdf->openHere('Fit');
if ($row_factura['tipocfd'] == 3) {
$pdf->setStrokeColor(255, 0, 0);
}
if ($row_factura['tipocfd'] == 2) {
//.........这里部分代码省略.........
示例9: array
function b_header(Cezpdf &$pdf, $partner_typ, $partner_id, $orientation = 'portrait', $font_file, $f_size, $logo_file = '')
{
$diff = array(196 => 'Adieresis', 228 => 'adieresis', 214 => 'Odieresis', 246 => 'odieresis', 220 => 'Udieresis', 252 => 'udieresis', 223 => 'germandbls');
$pdf->selectFont('Helvetica', array('encoding' => 'WinAnsiEncoding', 'differences' => $diff));
$all = $pdf->openObject();
$pdf->saveState();
$pdf->setStrokeColor(0, 0, 0, 1);
if ($orientation == 'portrait') {
$pdf->ezSetMargins(135, 70, 50, 50);
if (!isset($_REQUEST['no_logo'])) {
if ($logo_file == '') {
$logo_file = BERLUS_PATH . "/print_css/{$partner_typ}/{$partner_id}" . "_logo.png";
}
if (file_exists("{$logo_file}")) {
$pdf->addPngFromFile("{$logo_file}", 200, 730, 200, 80);
$pdf->line(43, 725, 545, 725);
$pdf->line(42, 50, 550, 50);
}
} else {
$logo_file = BERLUS_PATH . "/print_css/{$partner_typ}/{$partner_id}" . "_logo.png";
}
$pdf->setLineStyle(0.5);
$this->footer_info($partner_typ, $partner_id);
$pdf->addText(43, 718, $f_size, "{$this->header_zeile}");
$pdf->ezStartPageNumbers(545, 715, $f_size, '', 'Seite {PAGENUM} von {TOTALPAGENUM}', 1);
$pdf->setLineStyle(0.5);
if (!isset($_REQUEST['no_logo'])) {
$pdf->addText($pdf->ez['pageWidth'] / 2, 42, $f_size, "{$this->zeile1}", 0, 'center');
$pdf->addText($pdf->ez['pageWidth'] / 2, 35, $f_size, "{$this->zeile2}", 0, 'center');
}
} else {
$pdf->ezSetMargins(120, 40, 30, 30);
$logo_file = BERLUS_PATH . "/print_css/{$partner_typ}/{$partner_id}" . "_logo.png";
if (file_exists("{$logo_file}")) {
$pdf->addPngFromFile("{$logo_file}", 320, 505, 200, 80);
} else {
$pdf->addText(370, 505, $f_size, "Vorschau / Druckansicht ");
}
$pdf->setLineStyle(0.5);
$this->footer_info($partner_typ, $partner_id);
$pdf->line(43, 500, 785, 500);
$pdf->addText(43, 493, $f_size, "{$this->header_zeile}");
$pdf->ezStartPageNumbers(783, 493, $f_size, '', 'Seite {PAGENUM} von {TOTALPAGENUM}', 1);
$pdf->setLineStyle(0.5);
$pdf->line(42, 30, 785, 30);
$pdf->addText($pdf->ez['pageWidth'] / 2, 23, $f_size, "{$this->zeile1}", 0, 'center');
$pdf->addText($pdf->ez['pageWidth'] / 2, 16, $f_size, "{$this->zeile2}", 0, 'center');
}
$pdf->restoreState();
$pdf->closeObject();
$pdf->addObject($all, 'all');
}
示例10: CREATEPDF
function CREATEPDF($p)
{
$sGeo = explode("|", $p);
$tokens = explode(",", $sGeo[0]);
$sMin = explode(" ", $tokens[0]);
$sMax = explode(" ", $tokens[2]);
$sMinX = $sMin[0];
$sMinY = $sMin[1];
$oPDF = new Cezpdf('a4', 'portrait') or die("Kan PDFLib niet gebruiken");
$oPDF->ezSetMargins(20, 20, 20, 20);
$oPDF->openHere('Fit');
$ext1 = $sMax[1] - $sMin[0];
$ext2 = $sMax[2] - $sMin[1];
$oPDF->setLineStyle(2);
$oPDF->rectangle(20, 20, 595.28 - 40, 841.89 - 40);
for ($iRecord = 1; $iRecord < count($sGeo) - 1; $iRecord++) {
$oPDF->setLineStyle(0.1);
$oPDF->setColor(1, 0, 0);
$oPDF->setStrokeColor(0.5, 0.5, 0.5);
$tokens = explode(",", $sGeo[$iRecord]);
$point = array();
$waarde = 0;
//$waardex = (297.64);
//$waardey = (420.945);
//$waardex = 0;
//$waardey = 0;
for ($gRecord = 0; $gRecord < count($tokens); $gRecord++) {
$sPunt = explode(" ", $tokens[$gRecord]);
if ($gRecord == 0) {
$sX = $sPunt[0] - $sMinX;
$sY = $sPunt[1] - $sMinY;
$point[$waarde] = $sX * 1000 / 0.3528 / 350000;
$point[$waarde + 1] = $sY * 1000 / 0.3528 / 350000;
} elseif ($gRecord == count($tokens) - 1) {
$sX = $sPunt[1] - $sMinX;
$sY = $sPunt[2] - $sMinY;
$point[$waarde] = $sX * 1000 / 0.3528 / 350000;
$point[$waarde + 1] = $sY * 1000 / 0.3528 / 350000;
} else {
$sX = $sPunt[1] - $sMinX;
$sY = $sPunt[2] - $sMinY;
$point[$waarde] = $sX * 1000 / 0.3528 / 350000;
$point[$waarde + 1] = $sY * 1000 / 0.3528 / 350000;
}
$waarde = $waarde + 2;
}
$oPDF->polygon($point, $waarde / 2, 1);
$oPDF->polygon($point, $waarde / 2);
unset($point);
}
$oPDF->ezStream();
}