本文整理汇总了PHP中Cezpdf::openHere方法的典型用法代码示例。如果您正苦于以下问题:PHP Cezpdf::openHere方法的具体用法?PHP Cezpdf::openHere怎么用?PHP Cezpdf::openHere使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cezpdf
的用法示例。
在下文中一共展示了Cezpdf::openHere方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Cezpdf
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";
} else {
示例2: array
case "namen":
// name zusammenfassen
$name_join = array("abtitel", "abnamra", "abnamvor", "abamtbezkurz", "abad");
//$cfg["db"]["sql"][2] = "SELECT !felder! FROM db_adrb INNER JOIN db_adrb_dienst ON abdienst_id=abdstposten INNER JOIN db_adrb_amtbez ON abamtbez_id=abamtbez WHERE abdststelle = \"". $HTTP_GET_VARS["adid"]."\" AND abanrede !=\"Raum\" ORDER BY abnamra";
// alle sql befehle
$cfg["db"]["sql"][1] = "SELECT adkate, adststelle, adtelver, adbnet, adcnet FROM db_adrd WHERE adid =" . $HTTP_GET_VARS["adid"];
$cfg["db"]["sql"][2] = "SELECT !felder! FROM db_adrb INNER JOIN db_adrb_dienst ON abdienst_id=abdstposten INNER JOIN db_adrb_amtbez ON abamtbez_id=abamtbez WHERE abdststelle = " . $HTTP_GET_VARS["adid"] . " ORDER BY abnamra";
#$cfg["db"]["sql"][3] = "SELECT !felder! FROM db_adrb WHERE abdststelle = \"". $HTTP_GET_VARS["adid"]."\" AND abanrede =\"Raum\" ORDER BY abnamra";
#$cfg["db"]["sql"][3] = "SELECT !felder! FROM db_adrb WHERE abdststelle = '". $HTTP_GET_VARS["adid"]."' AND (abdstmobil != '+49-' AND abdstmobil != '') ORDER BY abnamra";
// besondere nicht benötigte felder entfernen
$kck_main = $kick;
#$tab_left = array( "abtitel", "abnamra", "abnamvor", "abdstmobil");
$pdfkopf = "telint";
break;
# case "adrd":
# $cfg["sql"][1] = "";
# $cfg["sql"][2] = "";
# break;
}
include_once $pathvars["libraries"] . "xtra.pdf.php";
include_once $pathvars["libraries"] . "xtra.ezpdf.php";
$pdf = new Cezpdf();
$pdf->selectFont('./fonts/Helvetica.afm');
$pdf->openHere("Fit");
// seiten raender
# $pdf->ezSetMargins(80,40,50,40); // top, bottom, left, right
$pdf->ezSetMargins(80, 90, 50, 40);
// top, bottom, left, right
// seiten nummern
$pdf->ezStartPageNumbers(330, 20, 12, '', 'Seite {PAGENUM} von {TOTALPAGENUM}', 1);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
示例3: 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><?
}
示例4: 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
//.........这里部分代码省略.........
示例5: 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 ...
//.........这里部分代码省略.........
示例6: 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) {
//.........这里部分代码省略.........
示例7: 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();
}