本文整理汇总了PHP中Cezpdf::ezNewPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Cezpdf::ezNewPage方法的具体用法?PHP Cezpdf::ezNewPage怎么用?PHP Cezpdf::ezNewPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cezpdf
的用法示例。
在下文中一共展示了Cezpdf::ezNewPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upload_file_to_client_pdf
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);
}
示例2: count
function berechnung_anzeigen($leerstand_arr, $vermietete_arr, $monat, $jahr)
{
echo '<pre>';
// print_r($vermietete_arr);
$anzahl_vermietete = count($vermietete_arr);
$mv = new mietvertrag();
$m = new mietkonto();
$haeuser = array();
$gsollmiete_vermietet = 0;
for ($a = 0; $a < $anzahl_vermietete; $a++) {
$einheit_id = $vermietete_arr[$a]['EINHEIT_ID'];
$haus_str = $vermietete_arr[$a]['HAUS_STRASSE'];
$haus_nr = $vermietete_arr[$a]['HAUS_NUMMER'];
$haus_str_nr = $haus_str . ' ' . $haus_nr;
if (!in_array($haus_str_nr, $haeuser)) {
$haeuser[] = $haus_str_nr;
}
$mv->get_mietvertrag_infos_aktuell($einheit_id);
$summe_f_monatlich = $m->summe_forderung_monatlich($mv->mietvertrag_id, $monat, $jahr);
$gsollmiete_vermietet = $gsollmiete_vermietet + $summe_f_monatlich;
}
$anzahl_leer = count($leerstand_arr);
$gsollmiete_leer = 0;
for ($b = 0; $b < $anzahl_leer; $b++) {
$einheit_id = $leerstand_arr[$b]['EINHEIT_ID'];
$haus_str = $leerstand_arr[$b]['HAUS_STRASSE'];
$haus_nr = $leerstand_arr[$b]['HAUS_NUMMER'];
$haus_str_nr = $haus_str . ' ' . $haus_nr;
if (!in_array($haus_str_nr, $haeuser)) {
$haeuser[] = $haus_str_nr;
}
$sollmiete_leer = $this->get_sollmiete_leerstand($einheit_id);
$gsollmiete_leer = $gsollmiete_leer + $sollmiete_leer;
}
// print_r($haeuser);
$g_summe = $gsollmiete_vermietet + $gsollmiete_leer;
$g_summe_a = nummer_punkt2komma($g_summe);
$gsollmiete_vermietet_a = nummer_punkt2komma($gsollmiete_vermietet);
$gsollmiete_leer_a = nummer_punkt2komma($gsollmiete_leer);
$v_geb = $g_summe / 100 * 5;
$brutto_vgeb = $v_geb * 1.19;
$mwst_eur = $v_geb / 100 * 19;
$mwst_eur = nummer_punkt2komma($mwst_eur);
$brutto_vgeb_a = nummer_punkt2komma($brutto_vgeb);
$v_geb_a = nummer_punkt2komma($v_geb);
if (!isset($_REQUEST['pdf'])) {
echo "{$gsollmiete_vermietet_a} € GESAMT SOLL VERMIETET<br>";
echo "{$gsollmiete_leer_a} € GESAMT SOLL LEER<br>";
echo " {$g_summe_a} € GESAMT SOLL<br>";
echo " {$v_geb_a} € NETTO VERWALTERGEBÜHR 5%<br>";
echo " <b>{$brutto_vgeb_a} € INKL. 19% MWST VERWALTERGEBÜHR 5%</b><hr>";
} else {
/* PDF AUSGABE */
ob_clean();
// ausgabepuffer leeren
header("Content-type: application/pdf");
// wird von MSIE ignoriert
//include_once ('pdfclass/class.ezpdf.php');
$pdf = new Cezpdf('a4', 'portrait');
$pdf->ezSetCmMargins(4.5, 1, 1, 1);
$berlus_schrift = 'pdfclass/fonts/Times-Roman.afm';
$text_schrift = 'pdfclass/fonts/Arial.afm';
$pdf->addJpegFromFile('includes/logos/logo_hv_sw.jpg', 220, 750, 175, 100);
// $pdf->addJpgFromFile('pdfclass/logo_262_150_sw1.jpg', 300, 500, 250, 150);
$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);
$monatsname = monat2name($monat);
$pdf->addText(42, 720, 12, "Berechnungsbogen für die Verwaltergebühr {$monatsname} {$jahr}");
$pdf->addText(42, 650, 10, "Gesamtsoll aus vermieteten Einheiten");
$pdf->addText(300, 650, 10, "{$gsollmiete_vermietet_a} €");
$pdf->addText(42, 635, 10, "Gesamtsoll aus leerstehenden Einheiten");
$pdf->addText(300, 635, 10, "{$gsollmiete_leer_a} €");
$pdf->setLineStyle(0.5);
$pdf->line(42, 630, 350, 630);
$pdf->addText(42, 620, 10, "<b>Gesamtsoll");
$pdf->addText(300, 620, 10, "{$g_summe_a} €</b>");
$pdf->addText(42, 595, 10, "5% Verwaltergebühr");
$pdf->addText(300, 595, 10, "{$v_geb_a} €");
$pdf->addText(42, 585, 10, "+ 19% MWSt");
$pdf->addText(300, 585, 10, "{$mwst_eur} €");
$pdf->setLineStyle(0.5);
$pdf->line(42, 580, 350, 580);
$pdf->addText(42, 570, 10, "<b>Verwaltergebühr brutto");
$pdf->addText(300, 570, 10, "{$brutto_vgeb_a} €</b>");
/* Häuser */
$pdf->addText(42, 480, 10, "In diese Berechnung wurden folgende Häuser einbezogen:");
$text_xpos = 460;
for ($c = 0; $c < count($haeuser); $c++) {
$haus = $haeuser[$c];
$pdf->addText(42, $text_xpos, 10, "<b>{$haus}</b>");
$text_xpos = $text_xpos - 10;
if ($text_xpos == 100) {
$pdf->ezNewPage();
$text_xpos = 650;
$pdf->ezSetCmMargins(4.5, 1, 1, 1);
$berlus_schrift = 'pdfclass/fonts/Times-Roman.afm';
$text_schrift = 'pdfclass/fonts/Arial.afm';
$pdf->addJpegFromFile('includes/logos/logo_hv_sw.jpg', 220, 750, 175, 100);
//.........这里部分代码省略.........
示例3: ezNewPage
public function ezNewPage()
{
if ($this->trigger['BeforeNewPage']) {
$this->callTrigger($this->trigger['BeforeNewPage']);
}
parent::ezNewPage();
if ($this->trigger['AfterNewPage']) {
$this->callTrigger($this->trigger['AfterNewPage']);
}
}
示例4: Cezpdf
//.........这里部分代码省略.........
$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";
}
}
示例5: printPDF
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;
//.........这里部分代码省略.........
示例6: 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><?
}
示例7: kontenrahmen
function ihr_pdf_einzeln(Cezpdf &$pdf, $p_id)
{
$this->get_hga_profil_infos($p_id);
$this->p_ihr_gk_id;
$kk = new kontenrahmen();
$kontenrahmen_id = $kk->get_kontenrahmen('Geldkonto', $this->p_ihr_gk_id);
$bb = new buchen();
$kontostand11 = $bb->kontostand_tagesgenau_bis($this->p_ihr_gk_id, "01.01.{$this->p_jahr}");
if (!$kontostand11) {
$kontostand11 = $this->get_kontostand_manuell($this->p_ihr_gk_id, $this->p_jahr . "-01-01");
}
$kontostand11_a = nummer_punkt2komma_t($kontostand11);
$ze = 0;
$tab_arr[$ze]['TEXT'] = "I. Anfangsbestand 01.01.{$this->p_jahr}";
$tab_arr[$ze]['SOLL'] = "{$kontostand11_a} € ";
$tab_arr[$ze]['IST'] = "{$kontostand11_a} € ";
$ze++;
$soll_summe_wp = $this->get_soll_betrag_wp(6040, $this->p_wplan_id);
$soll_summe_wp_a = nummer_punkt2komma_t($soll_summe_wp);
$tab_arr[$ze]['TEXT'] = "II. Soll-Zuführung zur Rücklage laut WP";
$tab_arr[$ze]['SOLL'] = "";
$tab_arr[$ze]['IST'] = "{$soll_summe_wp_a} € ";
$ze++;
$iii_arr[] = $this->III_tab_anzeigen_pdf($p_id);
if (is_array($iii_arr)) {
$iii_arr = $iii_arr[0];
for ($a = 0; $a < sizeof($iii_arr); $a++) {
$text3 = $iii_arr[$a]['TEXT'];
$ist3 = $iii_arr[$a]['IST'];
$tab_arr[$ze]['TEXT'] = $text3;
$tab_arr[$ze]['IST'] = $ist3;
$ze++;
}
}
$soll_endbestand = $kontostand11 + $soll_summe_wp;
$soll_endbestand_a = nummer_punkt2komma_t($soll_endbestand);
$tab_arr[$ze]['TEXT'] = "IV. Soll-Endbestand 31.12.{$this->p_jahr}";
$tab_arr[$ze]['SOLL'] = "";
$tab_arr[$ze]['IST'] = "{$soll_endbestand_a} € ";
$n_jahr = $this->p_jahr + 1;
$kontostand11 = $bb->kontostand_tagesgenau_bis($this->p_ihr_gk_id, "01.01.{$n_jahr}");
if (!$kontostand11) {
$kontostand11 = $this->get_kontostand_manuell($this->p_ihr_gk_id, $this->p_jahr . "-12-31");
}
$kontostand11_a = nummer_punkt2komma_t($kontostand11);
$ze++;
$tab_arr[$ze]['TEXT'] = "V. Endbestand 31.12.{$this->p_jahr}";
$tab_arr[$ze]['SOLL'] = "";
$tab_arr[$ze]['IST'] = "{$kontostand11_a} € ";
$this->footer_zahlungshinweis = $bpdf->zahlungshinweis;
$pdf->setColor(0.6, 0.6, 0.6);
$pdf->filledRectangle(50, 690, 500, 15);
$pdf->setColor(0, 0, 0);
$pdf->ezSety(720);
// $pdf->ezSetY(650);
$datum = date("d.m.Y");
$p = new partners();
$p->get_partner_info($_SESSION['partner_id']);
$pdf->ezText("{$p->partner_ort}, den {$datum}", 10, array('justification' => 'right'));
$pdf->ezSetY(705);
$o = new objekt();
$o->get_objekt_infos($this->p_objekt_id);
$pdf->ezText(" <b>Entwicklung der Instandhaltungsrücklage {$this->p_jahr} | OBJEKT: {$o->objekt_kurzname}</b>", 10, array('justification' => 'full'));
$pdf->ezSetDy(-15);
$pdf->ezStopPageNumbers();
// seitennummerirung beenden
$p = new partners();
$p->get_partner_info($_SESSION['partner_id']);
$cols = array('TEXT' => "", 'IST' => "IST-BETRAG");
$pdf->ezTable($tab_arr, $cols, "", array('rowGap' => 1.5, 'showLines' => 1, 'showHeadings' => 1, 'shaded' => 1, 'shadeCol' => array(0.9, 0.9, 0.9), 'titleFontSize' => 7, 'fontSize' => 10, 'xPos' => 'left', 'xOrientation' => 'right', 'width' => 500, 'cols' => array('TEXT' => array('justification' => 'left'), 'SOLL' => array('justification' => 'right', 'width' => 100), 'IST' => array('justification' => 'right', 'width' => 100))));
$this->get_hga_profil_infos($p_id);
$d = new detail();
$anteile_g = $d->finde_detail_inhalt('OBJEKT', $this->p_objekt_id, 'Gesamtanteile');
$einheiten_arr = $this->einheiten_weg_tabelle_arr($this->p_objekt_id);
$anz_einheiten = count($einheiten_arr);
$anz_konten = count($tab_arr);
$gkkk = new geldkonto_info();
$gkkk->geld_konto_details($this->p_ihr_gk_id);
$datum_heute = date("d.m.Y");
$kontostand_aktuell = nummer_punkt2komma_t($bb->kontostand_tagesgenau_bis($this->p_ihr_gk_id, "{$datum_heute}"));
for ($a = 0; $a < $anz_einheiten; $a++) {
$pdf->ezNewPage();
$e_kn = $einheiten_arr[$a]['EINHEIT_KURZNAME'];
$einheit_id = $einheiten_arr[$a]['EINHEIT_ID'];
$einheit_anteile = $d->finde_detail_inhalt('EINHEIT', $einheit_id, 'WEG-Anteile');
$pdf->setColor(0.6, 0.6, 0.6);
$pdf->filledRectangle(50, 690, 500, 15);
$pdf->setColor(0, 0, 0);
$pdf->ezSety(720);
$pdf->ezText("{$p->partner_ort}, den {$datum}", 10, array('justification' => 'right'));
$pdf->ezSetDy(-2);
$pdf->ezText("<b> Anteil in der Instandhaltungsrücklage für {$e_kn} | OBJEKT: {$o->objekt_kurzname} {$this->p_jahr}</b>", 10, array('justification' => 'full'));
$pdf->ezSetDy(-10);
$pdf->ezText("<b>Geldkontobezeichnung:</b> {$gkkk->geldkonto_bez}", 9);
$pdf->ezText("<b>Geldinstitut:</b> {$gkkk->kredit_institut}", 9);
$pdf->ezText("<b>IBAN:</b> {$gkkk->IBAN1}", 9);
$pdf->ezText("<b>BIC:</b> {$gkkk->BIC}", 9);
for ($b = 0; $b < $anz_konten; $b++) {
$tab_arr_e[$b]['TEXT'] = $tab_arr[$b]['TEXT'];
$tab_arr_e[$b]['IST'] = $tab_arr[$b]['IST'];
//.........这里部分代码省略.........
示例8: ezNewPage
function ezNewPage($debug = false)
{
parent::ezNewPage();
if (!$this->set_pageNumbering) {
$template = $this->converter->newSmarty();
$parser = new PDFParser();
$parser->parse($template->fetch('pagenumbering.tpl'), $this->font_dir, $this);
}
$this->set_pageNumbering = true;
}
示例9: upload_file_to_client_pdf
function upload_file_to_client_pdf($file_to_send)
{
//Function reads a HTML file and converts to pdf.
global $STMT_TEMP_FILE_PDF;
global $srcdir;
if ($GLOBALS['statement_appearance'] == '1') {
require_once "{$srcdir}/html2pdf/vendor/autoload.php";
$pdf2 = new HTML2PDF($GLOBALS['pdf_layout'], $GLOBALS['pdf_size'], $GLOBALS['pdf_language'], true, 'UTF-8', array($GLOBALS['pdf_left_margin'], $GLOBALS['pdf_top_margin'], $GLOBALS['pdf_right_margin'], $GLOBALS['pdf_bottom_margin']), $_SESSION['language_direction'] == 'rtl' ? true : false);
ob_start();
echo readfile($file_to_send, "r");
//this file contains the HTML to be converted to pdf.
//echo $file;
$content = ob_get_clean();
// Fix a nasty html2pdf bug - it ignores document root!
global $web_root, $webserver_root;
$i = 0;
$wrlen = strlen($web_root);
$wsrlen = strlen($webserver_root);
while (true) {
$i = stripos($content, " src='/", $i + 1);
if ($i === false) {
break;
}
if (substr($content, $i + 6, $wrlen) === $web_root && substr($content, $i + 6, $wsrlen) !== $webserver_root) {
$content = substr($content, 0, $i + 6) . $webserver_root . substr($content, $i + 6 + $wrlen);
}
}
$pdf2->WriteHTML($content);
$temp_filename = $STMT_TEMP_FILE_PDF;
$content_pdf = $pdf2->Output($STMT_TEMP_FILE_PDF, 'F');
} else {
$pdf = new Cezpdf('LETTER');
//pdf creation starts
$pdf->ezSetMargins(45, 9, 36, 10);
$pdf->selectFont('Courier');
$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 || stristr($OneLine, 'Future Appointments') == true || stristr($OneLine, 'Current') == 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);
}
示例10: explode
function pdf_einzel_tab(Cezpdf &$pdf, $bk_arr, $label, $kontroll_tab_druck)
{
$empf = $bk_arr['EMPF'];
$empf_kos_typ = $bk_arr['KOS_TYP'];
$empf_kos_id = $bk_arr['KOS_ID'];
$mieternummer = $bk_arr['EINHEIT_NAME'];
$zeitraum = $bk_arr['ZEITRAUM'];
$zeitraum_arr = explode('.', $zeitraum);
$anzahl_monate = $zeitraum_arr[3] - $zeitraum_arr[1] + 1;
$pdf->ergebnis_tab["{$mieternummer} - {$empf}"]['KOS_TYP'] = $empf_kos_typ;
$pdf->ergebnis_tab["{$mieternummer} - {$empf}"]['KOS_ID'] = $empf_kos_id;
$pdf->ergebnis_tab["{$mieternummer} - {$empf}"]['ZEITRAUM'] = $zeitraum;
$pdf->ergebnis_tab["{$mieternummer} - {$empf}"]['ANZ_MONATE'] = $anzahl_monate;
$einheit_typ = $bk_arr['EINHEIT_TYP'];
$einheit_qm = $bk_arr['EINHEIT_QM'];
$QM_G_OBJEKT = nummer_punkt2komma($bk_arr['QM_G_OBJEKT']);
$QM_G = nummer_punkt2komma($bk_arr['QM_G']);
$QM_G_GEWERBE = nummer_punkt2komma($bk_arr['QM_G_GEWERBE']);
$this->bk_profil_infos($_SESSION['profil_id']);
$anzahl_zeilen = count($bk_arr) - 10;
// WICHTIG 10 felder abschneiden
$cols = array('KOSTENART' => "Betriebskostenart", 'G_BETRAG' => "Gesamtkosten umlagefähige Betriebskosten", 'G_HNDL' => "Gesamtkosten haushaltsnahe Dienst- und Handwerkerleistungen", 'G_KEY' => "Wohnfläche / Verteiler- Schlüssel in Mieteinheiten (ME)", 'QM_ME' => "Ihre ME", 'BET_HNDL' => "Anteil für Ihre Wohnung haushaltsnahe Dienst- und Handwerkerleistungen", 'BET_G' => "Beteiligung");
$g_beteiligung = 0.0;
$g_beteiligung_hnd = 0.0;
for ($b = 0; $b < $anzahl_zeilen; $b++) {
$tab[$b]['KOSTENART'] = $bk_arr[$b]['KOSTENART'];
$tab[$b]['G_KOS_BEZ'] = $bk_arr[$b]['G_KOS_BEZ'];
$tab[$b]['G_BETRAG'] = $bk_arr[$b]['G_BETRAG'];
$tab[$b]['ANTEIL'] = $bk_arr[$b]['ANTEIL'] . '%';
$tab[$b]['UMLAGE'] = $bk_arr[$b]['UMLAGE'];
$tab[$b]['ME'] = $bk_arr[$b]['ME'];
$tab[$b]['G_KEY'] = nummer_punkt2komma($bk_arr[$b]['G_KEY']) . ' ' . $bk_arr[$b]['ME'];
$tab[$b]['QM'] = $bk_arr[$b]['QM'];
$tab[$b]['QM_ME'] = nummer_punkt2komma($bk_arr[$b]['QM']) . ' ' . $bk_arr[$b]['ME'];
$tab[$b]['BET_G'] = $bk_arr[$b]['BET_G'];
$tab[$b]['G_HNDL'] = $bk_arr[$b]['G_HNDL'];
$tab[$b]['BET_HNDL'] = $bk_arr[$b]['BET_HNDL'];
$tab[$b]['GENKEY_ID'] = $bk_arr[$b]['GENKEY_ID'];
$g_beteiligung += nummer_komma2punkt($bk_arr[$b]['BET_G']);
$g_beteiligung_hndl += nummer_komma2punkt($bk_arr[$b]['BET_HNDL']);
}
/* Pr�fen ob Kaltwasserkosten worden sind */
$check_kw = $this->check_kw_abrechnung($empf_kos_typ, $empf_kos_id, $this->bk_jahr);
if ($check_kw == true) {
$kw_summe = $this->summe_kw_abrechnung($empf_kos_typ, $empf_kos_id, $this->bk_jahr);
$kw_summe_a = nummer_punkt2komma($kw_summe);
// $pdf->ezText("<b>Heiz- und Betriebskostenabrechnung Einheit: $mv->einheit_kurzname</b>",10);
$tab[$b + 1]['KOSTENART'] = 'Be- und Entwässerung lt. Kaltwasserabr.';
if ($kw_summe < 0) {
$kw_erg_a = 'Nachzahlung';
} else {
$kw_erg_a = 'Guthaben';
}
$tab[$b + 1]['G_KEY'] = 'n. Verbrauch';
$tab[$b + 1]['BET_G'] = $kw_summe_a;
$g_beteiligung += $kw_summe;
// die($g_beteiligung);
} else {
// $pdf->ezText("<b>Betriebskostenabrechnung $this->bk_jahr Einheit: $mv->einheit_kurzname</b>",10);
}
$b++;
$tab[$b + 1]['KOSTENART'] = '<b>Gesamtkosten</b>';
$tab[$b + 1]['BET_G'] = '<b>' . nummer_punkt2komma($g_beteiligung) . '</b>';
$tab[$b + 1]['BET_HNDL'] = '<b>' . nummer_punkt2komma($g_beteiligung_hndl) . '</b>';
$summe_nebenkosten_jahr = 0.0;
if ($empf_kos_typ == 'MIETVERTRAG') {
$mz = new miete();
$summe_nebenkosten_jahr = $mz->summe_nebenkosten_im_jahr($empf_kos_typ, $empf_kos_id, $this->bk_jahr);
$summe_hk_jahr = $mz->summe_nebenkosten_im_jahr($empf_kos_typ, $empf_kos_id, $this->bk_jahr);
} else {
$summe_nebenkosten_jahr = 0.0;
$summe_hk_jahr = '0.00';
}
$tab[$b + 2]['KOSTENART'] = '<b>Ihr Vorschuss/Jahr</b>';
$tab[$b + 2]['BET_G'] = '<b>' . nummer_punkt2komma($summe_nebenkosten_jahr) . '</b>';
$ergebnis = $g_beteiligung + $summe_nebenkosten_jahr;
// $ergebnis = $summe_nebenkosten_jahr- substr($g_beteiligung,1);
if ($ergebnis < 0) {
$txt = 'Nachzahlung';
$ergebnis_a = substr($ergebnis, 1);
}
if ($ergebnis > 0) {
$txt = 'Guthaben';
$ergebnis_a = $ergebnis;
}
if ($ergebnis == null) {
$txt = 'Ergebnis';
$ergebnis_a = $ergebnis;
}
$tab[$b + 3]['KOSTENART'] = "<b>{$txt}</b>";
$tab[$b + 3]['BET_G'] = '<b>' . nummer_punkt2komma($ergebnis_a) . '</b>';
$pdf->ezNewPage();
$pdf->ezStopPageNumbers();
// seitennummerirung beenden
/*
* $this->wirt_ges_qm = $wirt->g_qm;
* $this->wirt_g_qm_gewerbe = $wirt->g_qm_gewerbe;
* $this->wirt_g_qm_wohnen = $this->wirt_ges_qm - $this->wirt_g_qm_gewerbe;
*/
// $cols1 = array('KOSTENART'=>"Betriebskostenart","KOSTEN_GESAMT"=>"Kosten gesamt $QM_G_OBJEKT m²",'KOSTEN_GEWERBE'=>"Gewerbeanteil $QM_G_GEWERBE m²",'KOSTEN_WOHNRAUM'=>"Wohnanteil $QM_G m²");
//.........这里部分代码省略.........
示例11: BuildPDFReport
function BuildPDFReport($userid)
{
$GLOBALS["SartON"] = time();
$q = new mysql();
$sql = "SELECT * FROM quarantine_report_users WHERE userid='{$userid}' and `type`=1 and `enabled`=1";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
if ($ligne["enabled"] == 0) {
return;
}
$params = unserialize(base64_decode($ligne["parameters"]));
$days = $params["days"];
$subject = $params["subject"];
$subject = str_replace("{", "", $subject);
$subject = str_replace("}", "", $subject);
$session = md5($user->password);
if ($days < 1) {
$days = 2;
}
$user = new user($userid);
while (list($num, $ligne) = each($user->HASH_ALL_MAILS)) {
$recipient_sql[] = "mailto='{$ligne}'";
}
$date = date('Y-m-d');
$recipients = implode(" OR ", $recipient_sql);
$sql = "SELECT mailfrom,zDate,MessageID,DATE_FORMAT(zdate,'%W %D %H:%i') as tdate,subject FROM quarantine\n\tWHERE (zDate>DATE_ADD('{$date}', INTERVAL -{$days} DAY)) AND ({$recipients}) ORDER BY zDate DESC;";
if ($GLOBALS["VERBOSE"]) {
echo "{$sql}\n";
}
$datepdf = date('Y-m-d');
$results = $q->QUERY_SQL($sql, "artica_backup");
$num_rows = mysql_num_rows($results);
if (!$q->ok) {
send_email_events("Build SMTP quarantine report failed for {$uid}", "{$sql}\n{$q->mysql_error}", "postfix");
return null;
}
if ($num_rows == 0) {
return;
}
$pdf = new Cezpdf('a4', 'portrait');
$pdf->ezSetMargins(50, 70, 50, 50);
$all = $pdf->openObject();
$pdf->saveState();
//$pdf->setStrokeColor(0,0,0,1);
$pdf->line(20, 40, 578, 40);
$pdf->line(20, 822, 578, 822);
$pdf->addText(50, 34, 6, $date);
$pdf->restoreState();
$pdf->closeObject();
$pdf->addObject($all, 'all');
$mainFont = dirname(__FILE__) . "/ressources/fonts/Helvetica.afm";
$codeFont = dirname(__FILE__) . "/ressources/fonts/Courier.afm";
$pdf->selectFont($mainFont);
$pdf->ezText("{$user->DisplayName}\n", 30, array('justification' => 'centre'));
$pdf->ezText("{$subject}\n", 20, array('justification' => 'centre'));
$pdf->ezText("{$date} ({$num_rows} message(s))", 18, array('justification' => 'centre'));
$pdf->ezStartPageNumbers(100, 30, 12, "left", "Page {PAGENUM}/{TOTALPAGENUM}");
$pdf->ezNewPage();
$options = array('showLines' => 2, 'showHeadings' => 0, 'shaded' => 2, 'shadeCol' => array(1, 1, 1), 'shadeCol2' => array(0.8, 0.8, 0.8), 'fontSize' => 11, 'textCol' => array(0, 0, 0), 'textCol2' => array(1, 1, 1), 'titleFontSize' => 16, 'titleGap' => 8, 'rowGap' => 5, 'colGap' => 10, 'lineCol' => array(1, 1, 1), 'xPos' => 'left', 'xOrientation' => 'right', 'width' => 500, 'maxWidth' => 500);
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$mail_subject = $ligne["subject"];
$from = trim($ligne["mailfrom"]);
$zDate = $ligne["tdate"];
$MessageID = $ligne["MessageID"];
if ($from == null) {
$from = "unknown";
}
$domain = "unknown";
if (preg_match("#(.+?)@(.+)#", $from, $re)) {
$domain = $re[2];
}
$mail_subject = str_replace("{", "", $mail_subject);
$mail_subject = str_replace("}", "", $mail_subject);
$uri = "<c:alink:{{$params["URI"]}/user.quarantine.query.php?uid={$user->uid}&session={$session}&mail={$MessageID}>{$mail_subject}</c:alink>";
$data[] = array($zDate, $from, $uri);
}
$pdf->ezTable($data, $cols, $subject, $options);
$pdfcode = $pdf->output();
$fname = "/tmp/" . date('Ymdhi') . "-{$user->mail}-quarantines.pdf";
if ($GLOBALS["VERBOSE"]) {
echo "{$pdf->messages}\nbuilding {$fname}\n";
}
@unlink($fname);
if ($GLOBALS["VERBOSE"]) {
echo "Building {$fname}\n";
}
$fp = fopen($fname, 'w');
fwrite($fp, $pdfcode);
fclose($fp);
if (preg_match("#(.+?)@(.+)#", $user->mail, $re)) {
$domain = $re[2];
}
$PostmasterAdress = "no-reply-quarantine@{$domain}";
$ini = new Bs_IniHandler("/etc/artica-postfix/smtpnotif.conf");
if ($ini->_params["SMTP"]["smtp_sender"] != null) {
$PostmasterAdress = $ini->_params["SMTP"]["smtp_sender"];
}
if (file_exists('/etc/artica-postfix/settings/Daemons/PostfixPostmaster')) {
$PostmasterAdress = trim(@file_get_contents('/etc/artica-postfix/settings/Daemons/PostfixPostmaster'));
}
$unix = new unix();
//.........这里部分代码省略.........
示例12: creaPDF
//.........这里部分代码省略.........
$total = $comprobanteNode['total'];
$uuidsat = $row_factura['uuid'];
$cadenaQRCode = sprintf("?re=%s&rr=%s&tt=%s&id=%s", $rfce, $rfcr, $total, $uuidsat);
/*QR Code: Para usar qr_imgV2(): qr_imgV2(d,e,s,v,t);
d= datos Cadena o datos a ser codificados.
e= ECC level Puede ser L,M,Q,H (default M)
s= module size Para imagen JPEG:8; para PNG:4
v= version 1-40 8 recomendado.
t= image type "J":imagen jpeg, "P" o culaquier otra cosa: imagen PNG */
$img_filename = qr_imgV2($cadenaQRCode, "M", 8, 8, "J", $PATHQR);
//v:7-13 8 parece adecuado.
//$pdf->addJpegFromFile($img_filename,495,$pdf->y,90); //100
//$pdf->addJpegFromFile($img_filename,32,170,130); //100
$pdf->addJpegFromFile($img_filename, 32, $pdf->y - 140, 130);
//100
unlink($img_filename);
////////// i. Sello
if ($version === "3.2") {
$tableData = array(array("dato" => "<b>Sello Digital del Emisor</b>\n" . $row_factura['sello']), array("dato" => "<b>Sello Digital del SAT</b>\n" . $row_factura['selloSAT']));
} else {
$tableData = array(array("dato" => "<b>Sello Digital</b>\n" . $row_factura['sello']));
}
$colNames = array("dato" => "<b>Cant</b>");
$colOptions = array("dato" => array('justification' => 'left', 'width' => 400));
$options = array('showLines' => 1, 'showHeadings' => 0, 'shaded' => 0, 'shadeCol' => array(0.8, 0.8, 0.8), 'fontSize' => 7, 'textCol' => array(0, 0, 0), 'rowGap' => 5, 'colGap' => 5, 'xPos' => 175, 'xOrientation' => 'right', 'width' => 120, 'cols' => $colOptions, 'innerLineThickness' => 0.3, 'outerLineThickness' => 0.3);
// Dibuja la tabla sello
$pdf->ezSetDy(-10);
$pdf->ezTable($tableData, $colNames, "", $options);
/*$pdf->setColor(91,21,0);
$pdf->filledRectangle(30,167,134,151);
$pdf->setColor(1,1,1);
$pdf->filledRectangle(31,167.5,132.3,149.5);*/
////////// i. Cadena original
$columnaCadena = "";
if ($version === "3.2") {
$columnaCadena = sprintf("||1.0|%s|%s|%s|%s||", $row_factura['uuid'], $row_factura['FechaTimbrado'], $row_factura['selloCFD'], $row_factura['noCertificadoSAT']);
} else {
$columnaCadena = sprintf("%s", $row_factura['cadena']);
}
$tableData = array(array("dato" => "<b>Cadena original del complemento de certificacion digital del SAT</b>\n" . $columnaCadena), array("dato" => "<b>Folio Fiscal</b>\n" . $row_factura['uuid']));
$colNames = array("dato" => "<b>Cant</b>");
$colOptions = array("dato" => array('justification' => 'left', 'width' => 400));
$options = array('showLines' => 1, 'showHeadings' => 0, 'shaded' => 0, 'shadeCol' => array(0.8, 0.8, 0.8), 'fontSize' => 7, 'textCol' => array(0, 0, 0), 'rowGap' => 5, 'colGap' => 5, 'xPos' => 175, 'xOrientation' => 'right', 'width' => 120, 'cols' => $colOptions, 'innerLineThickness' => 0.3, 'outerLineThickness' => 0.3);
// Dibuja la tabla cadena original
$pdf->ezSetDy(-5);
$pdf->ezTable($tableData, $colNames, "", $options);
// Leyendas
$pdf->ezSetDy(-12);
$leyendas = "ESTE DOCUMENTO ES UNA REPRESENTACION IMPRESA DE UN CFDI.\n";
$pdf->setColor(0.5, 0.5, 0.5);
$pdf->ezText($leyendas, 5, array('left' => 50, 'justification' => 'center'));
$pdf->setColor(0, 0, 0);
$pdf->ezStream(array("filename" => $row_factura['folio'] . "_" . str_replace(" ", "-", $receptorNode['nombre'])));
//Necesario para que funcione ezStartPageNumbers
//REGRESA PARA PONER ENCABEZADO EN PAGINAS 2 ->
if ($contadorPagina != $contadorTotalPaginas) {
$pdf->ezNewPage();
$pdf->ezSetDy(-12);
}
$contadorPagina++;
}
//fin del foreach para la creacion del objeto pdf
//ESCRIBE REPORTE AL ARCHIVO.
//================================================================================
$pdfcode = $pdf->output();
error_log($tmpName);
if ($tmpName === 2 || !$tmpName) {
$tmpName = !$tmpName ? $tmpName : true;
} else {
exit($pdfcode);
}
//save the file
if ($tmpName) {
$nombrePDF = tempnam($tmp . "tmp/", 'face5') . ".pdf";
$nombreToks = explode("/", $nombrePDF);
if (count($nombreToks) < 2) {
$nombreToks = explode("\\", $nombrePDF);
}
$lastTok = count($nombreToks) - 1;
$nombrePDF = $nombreToks[$lastTok];
$archivoPDF = $tmp . "tmp/" . $nombrePDF;
$archivos = array($nombrePDF, $archivoPDF);
error_log(print_R($archivos, true));
} else {
$nombrePDF = $tipoDocto . "_" . $row_factura['serie'] . $row_factura['folio'] . ".pdf";
//$archivoPDF ="tmp/".$nombrePDF;//chs 20130705
$archivoPDF = $tmp . "tmp/" . $nombrePDF;
$archivos = array($nombrePDF, $archivoPDF);
error_log(2);
ob_flush();
ob_clean();
}
global $SITE_ROOT;
error_log($archivoPDF);
@file_put_contents($SITE_ROOT . "gui/" . $archivoPDF, $pdfcode);
/*$fp = fopen($archivoPDF,'w+');
fwrite($fp,$pdfcode);
fclose($fp);*/
return $archivos;
}
示例13: ezNewPage
function ezNewPage($insert = 0, $id = 0, $pos = 'after')
{
parent::ezNewPage($insert, $id, $pos);
switch ($this->bg_type) {
case 'colour':
$this->saveState();
$this->setColor($this->bg_color['r'], $this->bg_color['g'], $this->bg_color['b'], 1);
$this->filledRectangle(0, 0, $this->ez['pageWidth'], $this->ez['pageHeight']);
$this->restoreState();
break;
case 'image':
switch ($this->bg_img_type) {
case 'jpg':
$this->addJpegFromFile($this->bg_img, $this->bg_img_xpos, $this->bg_img_ypos, $this->bg_img_width, $this->bg_img_height);
break;
case 'png':
$this->addPngFromFile($this->bg_img, $this->bg_img_xpos, $this->bg_img_ypos, $this->bg_img_width, $this->bg_img_height);
break;
}
break;
case 'none':
default:
break;
}
}
示例14: addTable
function addTable(Cezpdf &$pdf, &$data, $cols = '', $title = '', $options = '')
{
$pdf->transaction('start');
$pageNumber = $pdf->ezGetCurrentPageNumber();
$pdf->ezTable($data, $cols, $title, $options);
if ($pageNumber < $pdf->ezGetCurrentPageNumber()) {
$pdf->transaction('rewind');
} else {
$pdf->transaction('commit');
return;
}
$pdf->ezNewPage();
$pageNumber = $pdf->ezGetCurrentPageNumber();
$pdf->ezTable($data, $cols, $title, $options);
if ($pageNumber < $pdf->ezGetCurrentPageNumber()) {
$pdf->transaction('rewind');
$pdf->ezTable($data, $cols, $title, $options);
}
$pdf->transaction('commit');
}
示例15: pdfObservations
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();
}