本文整理汇总了PHP中Cezpdf::output方法的典型用法代码示例。如果您正苦于以下问题:PHP Cezpdf::output方法的具体用法?PHP Cezpdf::output怎么用?PHP Cezpdf::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cezpdf
的用法示例。
在下文中一共展示了Cezpdf::output方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
while ($orders = tep_db_fetch_array($orders_query)) {
$order = new order($orders['orders_id']);
switch ($pdf_check) {
case 'invoice':
require DIR_WS_MODULES . 'batch_print/templates/Invoice_s3.php';
break;
case 'packingslip':
require DIR_WS_MODULES . 'batch_print/templates/Packing-Slip.php';
break;
default:
break;
}
// end switch
}
// end while
$pdf_code = $pdf->output();
$fname = BATCH_PDF_DIR . BATCH_PDF_FILE;
if ($fp = fopen($fname, 'w')) {
fwrite($fp, $pdf_code);
fclose($fp);
}
// end if
tep_redirect(tep_href_link(DIR_WS_MODULES . 'batch_print/temp_pdf/batch_orders.pdf', '', 'NONSSL', false));
}
// end if pdf
if (tep_not_null($action)) {
switch ($action) {
case 'update_order':
$oID = tep_db_prepare_input($_GET['oID']);
$status = tep_db_prepare_input($_POST['status']);
$comments = tep_db_prepare_input($_POST['comments']);
示例2: pdfoutput__make_pdf_calendar
function pdfoutput__make_pdf_calendar($displayfrom = 0, $wholeyear = false, $admin = false, $forward = 0, $file = false)
{
global $settings, $lang;
if ($displayfrom == 0) {
$displayfrom = time();
}
// prepare pdf
include_once '../tagsets/class.ezpdf.php';
$pdf = new Cezpdf('a4');
$pdf->selectFont('../tagsets/fonts/Times-Roman.afm');
$fontsize = $settings['calendar_pdf_table_fontsize'] ? $settings['calendar_pdf_table_fontsize'] : 8;
$titlefontsize = $settings['calendar_pdf_title_fontsize'] ? $settings['calendar_pdf_title_fontsize'] : 12;
//start building calendar
$displayfrom_lower = $displayfrom;
$displayfrom_upper = date__skip_months($forward, $displayfrom_lower);
if ($wholeyear) {
$displayfrom_upper = mktime(0, 0, 0, 1, 1, date('Y', $displayfrom) + 1);
}
$results = calendar__get_events($admin, $displayfrom_lower, $displayfrom_upper, false, true);
$month_names = explode(",", $lang['month_names']);
//loop through each month
for ($itime = $displayfrom_lower; $itime <= $displayfrom_upper; $itime = date__skip_months(1, $itime)) {
$year = date("Y", $itime);
$month = date("m", $itime);
$weeks = days_in_month($month, $year);
$table_title = $month_names[$month - 1] . ' ' . $year;
$table_headings = array();
$calendar__weekdays = explode(",", $lang['format_datetime_weekday_abbr']);
for ($i3 = 1; $i3 <= 7; ++$i3) {
if (!isset($lang['format_datetime_firstdayofweek_0:Su_1:Mo']) || !$lang['format_datetime_firstdayofweek_0:Su_1:Mo']) {
$wdindex = $i3 - 2;
if ($wdindex < 0) {
$wdindex = 6;
}
} else {
$wdindex = $i3 - 1;
}
$table_headings[$i3] = $calendar__weekdays[$wdindex];
}
$table_data = array();
for ($i2 = 1; $i2 <= count($weeks); ++$i2) {
$las1 = array();
$las2 = array();
for ($i3 = 1; $i3 <= 7; ++$i3) {
if (!isset($weeks[$i2][$i3])) {
$las1[$i3] = "";
$las2[$i3] = "";
} else {
$las1[$i3] = $weeks[$i2][$i3];
$las2[$i3] = "";
//the date is the key of the $results array for easy searching
$today = $year * 10000 + $month * 100 + $weeks[$i2][$i3];
if (isset($results[$today])) {
foreach ($results[$today] as $item) {
$las2[$i3] .= $item['display_time'];
$las2[$i3] .= "\n" . "<i>" . $item['location'] . "</i>\n";
if ($admin || $settings['public_calendar_hide_exp_name'] != 'y') {
$las2[$i3] .= '<b>' . $item['title'] . '</b>';
} else {
$las2[$i3] .= '<b>' . $lang['calendar_experiment_session'] . '</b>';
}
$las2[$i3] .= "\n";
if ($admin) {
$las2[$i3] .= experiment__list_experimenters($item['experimenters'], false, true) . "\n";
}
if ($item['type'] == "experiment_session") {
if ($admin) {
$las2[$i3] .= $item['participants_registered'] . " (" . $item['participants_needed'] . "," . $item['participants_reserve'] . ")";
} else {
$las2[$i3] .= $statusdata[$item['status']]['message'];
}
}
$las2[$i3] .= "\n\n";
}
}
}
}
$table_data[] = $las1;
$table_data[] = $las2;
}
$y = $pdf->ezTable($table_data, $table_headings, $table_title, array('gridlines' => 31, 'showHeadings' => 1, 'shaded' => 2, 'shadeCol' => array(1, 1, 1), 'shadeCol2' => array(0.9, 0.9, 1), 'fontSize' => $fontsize, 'titleFontSize' => $titlefontsize, 'rowGap' => 1, 'colGap' => 3, 'innerLineThickness' => 0.5, 'outerLineThickness' => 1, 'maxWidth' => 500, 'width' => 500, 'protectRows' => 2));
$pdf->ezSetDy(-20);
}
if ($file) {
$pdffilecode = $pdf->output();
return $pdffilecode;
//$fname ="/apache/orsee/admin/pdfdir/test.pdf";
//$fp = fopen($fname,'w');
//fwrite($fp,$pdffilecode);
//fclose($fp);
//echo '<A HREF="pdfdir/test.pdf" target="_blank">pdf file</A><BR><BR>';
//$pdfcode = str_replace("\n","\n<br>",htmlspecialchars($pdfcode));
//echo trim($pdfcode);
} else {
$pdf->ezStream(array('Content-Disposition' => 'calendar.pdf', 'Accept-Ranges' => 0, 'compress' => 1));
}
}
示例3: kontenrahmen
function kontobuchungen_pdf($geldkonto_id, $kostenkonto, $jahr, $monat)
{
if ($monat == '') {
$result = mysql_query("SELECT DATUM, BETRAG, VERWENDUNGSZWECK FROM GELD_KONTO_BUCHUNGEN WHERE GELDKONTO_ID='{$geldkonto_id}' && KONTENRAHMEN_KONTO = '{$kostenkonto}' && ( DATE_FORMAT( DATUM, '%Y' ) = '{$jahr}') && AKTUELL='1' ORDER BY GELD_KONTO_BUCHUNGEN_ID DESC");
} else {
$result = mysql_query("SELECT DATUM, BETRAG, VERWENDUNGSZWECK FROM GELD_KONTO_BUCHUNGEN WHERE GELDKONTO_ID='{$geldkonto_id}' && KONTENRAHMEN_KONTO = '{$kostenkonto}' && ( DATE_FORMAT( DATUM, '%Y-%m' ) = '{$jahr}-{$monat}') && AKTUELL='1' ORDER BY GELD_KONTO_BUCHUNGEN_ID DESC");
}
$numrows = mysql_numrows($result);
if ($numrows > 0) {
$k = new kontenrahmen();
$k->konto_informationen($kostenkonto);
/* PDF */
//include_once ('pdfclass/class.ezpdf.php');
$pdf = new Cezpdf('a4', 'portrait');
$pdf->ezSetCmMargins(4.5, 2.5, 2.5, 2.5);
$berlus_schrift = './fonts/Times-Roman.afm';
$text_schrift = './fonts/Arial.afm';
$pdf->addJpegFromFile('includes/logos/hv_logo198_80.jpg', 450, 780, 100, 42);
$pdf->setLineStyle(0.5);
$pdf->selectFont($berlus_schrift);
$pdf->addText(42, 743, 6, "BERLUS HAUSVERWALTUNG - Fontanestr. 1 - 14193 Berlin");
$pdf->line(42, 750, 550, 750);
$seite = $pdf->ezGetCurrentPageNumber();
$alle_seiten = $pdf->ezPageCount;
$pdf->addText(70, 780, 12, "Kostenkonto {$kostenkonto}");
while ($row = mysql_fetch_assoc($result)) {
$datum = date_mysql2german($row[DATUM]);
$betrag = nummer_punkt2komma($row[BETRAG]);
$vzweck = $this->umlaute_anpassen(ltrim(rtrim($row[VERWENDUNGSZWECK])));
$this->summe_kontobuchungen_jahr($geldkonto_id, $kostenkonto, $jahr);
echo "<tr></td><td>{$datum}</td><td>{$erfass_nr}</td><td>{$betrag}</td><td>{$b_id}</td><td>{$vzweck}</td></tr><br>";
$pdf->ezText("{$datum}", 10, array('left' => '0'));
if (strlen($vzweck) > '60') {
$pdf->ezText("{$vzweck}", 10, array('left' => '60'));
// $pdf->ezSetDy(-12); //abstand
} else {
$pdf->ezText("{$vzweck}", 10, array('left' => '60'));
}
$pdf->ezText("{$betrag}", 10, array('left' => '430'));
$pdf->ezSetDy(-12);
// abstand
}
$content = $pdf->output();
$dateiname_org = 'Kontenbericht';
$dateiname = $this->save_file($dateiname_org, 'Monatsbericht_Konten', $geldkonto_id, $content, $monat, $jahr);
// weiterleiten($dateiname);
$download_link = "<h3><a href=\"{$dateiname}\">Monatsbericht {$geldkonto_id} für {$monat}/{$jahr} HIER</a></h3>";
echo $download_link;
} else {
// echo "Geldkonto $geldkonto_id - Kostenkonto $kostenkonto leer<br>";
}
}
示例4: 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();
//.........这里部分代码省略.........
示例5: 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;
}