function _putpages() { $nb = $this->page; if (!empty($this->PageGroups)) { // do page number replacement foreach ($this->PageGroups as $k => $v) { for ($n = 1; $n <= $nb; $n++) { $this->pages[$n] = str_replace($k, $v, $this->pages[$n]); } } } parent::_putpages(); }
/** * Objekte auf PDF zeichnen * * @param array $templ * @param array $data */ function _write_object($templ, $data) { global $barcode; for ($i = 0; $i < count($templ); $i++) { if ($templ[$i]['user_type'] == $row['type'] || $templ[$i]['user_type'] == "0") { switch ($templ[$i]['type']) { case 'text': $this->pdf->SetFont($templ[$i]['font'], '', $templ[$i]["fontsize"]); $this->pdf->SetTextColor($templ[$i]["red"], $templ[$i]["green"], $templ[$i]["blue"]); if ($templ[$i]['end_x'] == "1") { $this->pdf->Text($templ[$i]["pos_x"] - $this->pdf->GetStringWidth($templ[$i]['text']) + $this->x, $templ[$i]["pos_y"] + $this->y, $templ[$i]['text']); } else { $this->pdf->Text($templ[$i]["pos_x"] + $this->x, $templ[$i]["pos_y"] + $this->y, $templ[$i]['text']); } break; case 'rect': $this->pdf->SetDrawColor($templ[$i]["red"], $templ[$i]["green"], $templ[$i]["blue"]); if ($templ[$i]['fontsize'] == "1") { $this->pdf->SetFillColor($templ[$i]["red"], $templ[$i]["green"], $templ[$i]["blue"]); $this->pdf->Rect($templ[$i]['pos_x'] + $this->x, $templ[$i]['pos_y'] + $this->y, $templ[$i]['end_x'], $templ[$i]['end_y'], "FD"); } else { $this->pdf->SetFillColor(255); $this->pdf->Rect($templ[$i]['pos_x'] + $this->x, $templ[$i]['pos_y'] + $this->y, $templ[$i]['end_x'], $templ[$i]['end_y']); } break; case 'line': $this->pdf->SetDrawColor($templ[$i]["red"], $templ[$i]["green"], $templ[$i]["blue"]); $this->pdf->Line($templ[$i]['pos_x'] + $this->x, $templ[$i]['pos_y'] + $this->y, $templ[$i]['end_x'] + $this->x, $templ[$i]['end_y'] + $this->y); break; case 'image': $this->pdf->Image(IMAGE_PATH . $templ[$i]['text'], $templ[$i]['pos_x'] + $this->x, $templ[$i]['pos_y'] + $this->y, $templ[$i]['end_x'], $templ[$i]['end_y']); break; case 'barcode': $imagename = mt_rand(100000, 999999); $barcode->get_image($data['userid'], BARCODE_PATH . $imagename); $this->pdf->Image(BARCODE_PATH . $imagename . ".png", $templ[$i]['pos_x'] + $this->x, $templ[$i]['pos_y'] + $this->y); $barcode->kill_image(BARCODE_PATH . $imagename); case 'data': $this->pdf->SetFont($templ[$i]['font'], '', $templ[$i]["fontsize"]); $this->pdf->SetTextColor($templ[$i]["red"], $templ[$i]["green"], $templ[$i]["blue"]); if ($templ[$i]['end_x'] == "1") { $this->pdf->Text($templ[$i]["pos_x"] - $this->pdf->GetStringWidth($data[$templ[$i]['text']]) + $this->x, $templ[$i]["pos_y"] + $this->y, $data[$templ[$i]['text']]); } else { $this->pdf->Text($templ[$i]["pos_x"] + $this->x, $templ[$i]["pos_y"] + $this->y, $data[$templ[$i]['text']]); } break; } } } }
function Output($file, $blah = 'I') { header('Pragma:', true); parent::Output($file, $blah); }
function _putcatalog() { parent::_putcatalog(); if (count($this->outlines) > 0) { $this->_out('/Outlines ' . $this->OutlineRoot . ' 0 R'); $this->_out('/PageMode /UseOutlines'); } }
function SetLink($link,$y=0,$page=-1) { if ($this->intpl) $this->Error('Setting links in templates aren\'t possible!'); parent::SetLink($link,$y,$page); }
function _endpage() { if ($this->angle != 0) { $this->angle = 0; $this->_out('Q'); } parent::_endpage(); }
} else { $dateQ = "SELECT max(lastrun), DATE_FORMAT(max(lastrun), '%M %D') FROM dates"; $dateR = mysqli_query($dbc, $dateQ); $date = mysqli_fetch_array($dateR, MYSQLI_NUM); $where = "timestamp > '{$date['0']}'"; $query = "SELECT ID, DATE_FORMAT(billdate, '%M %D'), amount, description, firstname\n FROM bills INNER JOIN payers\n ON (bills.payerid = payers.payerid)\n WHERE {$where}"; $header = " {$date['1']} to " . date('F jS'); } $payersQ = "SELECT firstname FROM payers WHERE active=1"; $payersR = mysqli_query($dbc, $payersQ); while ($row = mysqli_fetch_array($payersR)) { $payer[$row[0]] = 0.0; } $billQ = "SELECT ifnull(sum(amount),0) AS total, firstname\n FROM bills INNER JOIN payers\n ON (bills.payerid = payers.payerid)\n WHERE {$where}\n GROUP BY firstname\n ORDER BY firstname ASC"; $billR = mysqli_query($dbc, $billQ); $pdf = new fpdf('P', 'mm', 'Letter'); $pdf->setFont('Times', 'B', 20); $pdf->addPage(); $pdf->setY(20); $pdf->cell(0, 12, 'Bills from ' . $header, 0, 1, 'C'); $pdf->setY(40); $total = 0.0; while ($row = mysqli_fetch_array($billR, MYSQLI_NUM)) { $payer[$row[1]] = $row[0]; $total += $row[0]; } $num = mysqli_num_rows($payersR); $avg = $total / $num; $pdf->setFont('Times', 'B', 16); // 216 mm total, 203 writable $pdf->setX(7.5);
function _putcatalog() { parent::_putcatalog(); // Disable the page scaling option in the printing dialog $this->_out('/ViewerPreferences <</PrintScaling /None>>'); }
<?php include_once 'vendor/setasign/fpdf/fpdf.php'; $pdf = new fpdf(); // nouveau document PDF $pdf->addPage(); //ajout d'une page blanche $pdf->setFont('arial', '', 36); $pdf->Cell(190, 10, 'Bienvenue au Zoo Webforce 3', 0, 1, 'c'); $pdf->setTextColor(255, 0, 0); //couleur rouge $pdf->setFont('arial', '', 18); $pdf->Cell(190, 10, 'Veuillez ne pas jeter de CMS aux developpeurs ca les rend dingues!!!', 0, 1, 'c'); $pdf->output(); //envoi au navigateur
<?php include_once 'vendor/setasign/fpdf/fpdf.php'; $pdf = new fpdf(); $pdf->addPage(); $pdf->setFont('arial', '', 22); $pdf->Cell(190, 10, 'Hello les moutons!!!!!', 0, 1, 'C'); $pdf->Output(); //echo "ok";
include "../config.php"; include "../functions.php"; include "utility.php"; $cubename_sel = $_POST["cubename"]; $colonna = $_POST["ordinamento_col"]; $ordinamento = $_POST["ordinamento_type"]; $slice = $_POST["slice"]; $levels = unserialize(stripslashes($_POST['levels'])); $level_ser = implode("-", $levels); $query = SQLgenerator2($cubename_sel, $level_ser, $slice, $colonna, $ordinamento); $result = exec_query($query); $ncols = mysql_num_fields($result); define('FPDF_FONTPATH', '../fpdf/font/'); require '../fpdf/fpdf.php'; $p = new fpdf(); $p->Open(); $p->AddPage(); $p->SetTextColor(0); $p->SetFont('Arial', '', 8); $w = 10; $h = 10; $off_h = 5; $off_w = 40; //***************************Heading for ($i = 0; $i < $ncols; $i++) { $colname = mysql_fetch_field($result); $nome = $colname->name; $tabella = $colname->table; if ($tabella == "") { $field = "{$nome}";
} $cos = "\$" . number_format($myrow['precioVenta'], 2); $pdf->Ln(1); //salto de linea $pdf->SetX('22'); $pdf->Cell(0, 0, trim($myrow3['descripcion']), 0, 0, L); $pdf->SetX('170'); $pdf->Cell(0, 0, $myrow['cantidad'], 0, 0, M); $pdf->SetX('140'); $pdf->Cell(0, 0, $cos, 0, 0, R); $pdf->Ln(2); //salto de linea //$pdf->Ln(1); //salto de linea } //function Header() { $image = new fpdf(); $image->Image(CONSTANT_PATH_SIMA . '/imagenes/logohlc.jpg'); //} //function Footer() { //$this->Image('/sima/imagenes/logohlc.jpg'); //} $TOTAL = number_format($SUBTOTAL[0] + $iva, 2); $centavos = strstr($TOTAL, '.'); $centavos = substr($centavos, '1'); $resultado = numerotexto($TOTAL); $totalCaracteres = strlen($centavos); if ($totalCaracteres == '1') { $centavos = $centavos . '0'; } if (!$centavos) { $centavos = '00';
<?php session_start(); // User Inputs $name = $_POST['firstname'] . " " . $_POST['lastname']; $email = $_POST['email']; require "fpdf/fpdf.php"; //$pdf = new fpdf(); $pdf = new fpdf('P', 'mm', 'A4'); $pdf->SetMargins(5, 0, 0); $pdf->AddPage(); //$pdf->cMargin = 0; $pdf->Image('template/template.png', '', '', '210', '297', 'PNG'); $pdf->SetFont("Arial", "", "60"); $pdf->Cell(0, 40, $name, 1, 1, "L"); /* $pdf->SetFont("Arial", "U", "22"); $pdf->Cell(0, 10, $name, 1, 1, "C"); $pdf->SetFont("Arial", "I", "14"); $pdf->Cell(0, 10, $email, 1, 1, "C"); $pdf->SetFont("Arial", "I", "14"); $pdf->Cell(0, 10, 'test', 1, 1, "C");*/ $pdf->Output();
<?php include_once 'vendor/setasign/fpdf/fpdf.php'; $pdf = new fpdf(); // nouveau document PDF $pdf->addPage(); //ajout d'une page blanche $pdf->setFont('Arial', '', 12); //police arial 12 $pdf->Cell(190,10,'Hello World!',0,1,'C'); $pdf->setTextColor(255,0,0); //couleur rouge $pdf->Cell(190,10,'Copyright WF3',0,1,'C'); $pdf->Output(); // envoi au navigateur ?>
<?php // Inclui a class fpdf require 'pdf/fpdf.php'; // instancia a classe FPDF $pdf = new fpdf('P', 'mm', 'A4'); // define os atributos do pdf $pdf->SetTitle('Teste Pdf 1'); $pdf->SetAuthor('HsNunes'); $pdf->SetCreator('HELO Nunes, Php ' . phpversion()); $pdf->SetKeywords('php, pdf, relatorio'); $pdf->SetSubject('Contracheque PDF'); // adiciona uma pagina $pdf->AddPage(); $pdf->image('brasao_pb1.gif', 20, 13, 17, 0); // define fonte $pdf->SetFont('Arial', '', 10); $demo = 'DEMOSTRATIVO DE PAGAMENTO E SALÁRIO ( CONTRA-CHEQUE )'; $pref = 'PREFEITURA MUNICIPAL DE TOME-AÇU'; $end = 'AV. TRES PODERES, 8787 - CENTRO TOME-AÇU - CEP: 12345-999 - PA'; $doc = 'CNPJ: 05.196.530/0001-00'; $pdf->Cell(40, 23, '', 1, 0); $pdf->Cell(150, 23, '', 1, 1); // marca os qutros cantos da pagina //$pdf->Text( 20, 20, 'X1' ); //$pdf->Text( 190, 20, 'X2' ); //$pdf->Text( 0, 840, 'X3' ); //$pdf->Text( 576, 840, 'X4' ); $pdf->output();