public function drawPDF() { $pdf = new \FPDF('L', 'mm', 'Letter'); $pdf->SetMargins(3.175, 3.175, 3.175); $pdf->SetAutoPageBreak(false); if (\COREPOS\Fannie\API\FanniePlugin::isEnabled('CoopDealsSigns')) { $this->font = 'Gill'; $this->alt_font = 'GillBook'; define('FPDF_FONTPATH', dirname(__FILE__) . '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/'); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); } $pdf->SetFont($this->font, '', 16); $data = $this->loadItems(); $width = 136.52; $height = 105; $top = 90; $left = 15; $effective_width = $width - 2 * $left; foreach ($data as $item) { $pdf->AddPage(); $column = 1; // right aligned $price = $this->printablePrice($item); $pdf->SetXY($left + $width * $column, $top); $pdf->SetFontSize($this->SMALL_FONT); $pdf->Cell($effective_width, 10, $item['brand'], 0, 1, 'C'); $pdf->SetX($left + $width * $column); $pdf->SetFontSize($this->MED_FONT); $pdf->MultiCell($effective_width, 12, $item['description'], 0, 'C'); $pdf->SetX($left + $width * $column); $pdf->SetFontSize($this->BIG_FONT); $pdf->Cell($effective_width, 25, $price, 0, 1, 'C'); $y_pos = $pdf->GetY(); if ($item['startDate'] != '' && $item['endDate'] != '') { // intl would be nice $datestr = $this->getDateString($item['startDate'], $item['endDate']); $pdf->SetXY($left + $width * $column, $top + ($height - 40)); $pdf->SetFontSize($this->SMALL_FONT); $pdf->Cell($effective_width, 20, $datestr, 0, 1, 'R'); } if ($item['originName'] != '') { $pdf->SetXY($left + $width * $column, $y_pos); $pdf->SetFontSize($this->SMALL_FONT); if (strlen($item['originName']) < 50) { $pdf->Cell($effective_width, 20, $item['originName'], 0, 1, 'L'); } else { $pdf->Cell($effective_width, 20, $item['originShortName'], 0, 1, 'L'); } } } $pdf->Output('WfcProdSingle.pdf', 'I'); }
function preprocess() { if (FormLib::get_form_value('start', False) !== False) { $pdf = new FPDF('P', 'in', 'Letter'); $pdf->SetMargins(0.5, 0.5, 0.5); $pdf->SetAutoPageBreak(False, 0.5); $pdf->AddPage(); $start = FormLib::get_form_value('start'); $x = 0.5; $y = 0.5; $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $pdf->SetFont('Gill', '', 16); for ($i = 0; $i < 40; $i++) { $current = $start + $i; $pdf->SetXY($x, $y); $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C'); $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C'); if ($i % 2 == 0) { $x += 1.75 * 2 + 0.5; } else { $x = 0.5; $y += 0.5; } } $pdf->Close(); $pdf->Output("mem stickers {$start}.pdf", "I"); return False; } return True; }
function genpdf($typefacture, $datefacture, $nofacture, $montant, $civilite, $client, $contact, $chrono, $today) { $pdf = new FPDF("P", "mm", "A4"); $pdf->AddPage(); $pdf->SetMargins(20, 20); $pdf->AddFont("Arialb", "", "arialb.php"); //$pdf->AddFont("Courier","","arialb.php"); /////////////////////////////////////en tete//////////////////////////////////////// //logo $pdf->SetXY(18, 24); $X = $pdf->GetX(); $Y = $pdf->GetY(); $pdf->Image("img/logo.jpg", $X, $Y, 23, 19, "jpg"); //Commune de Faa"a $pdf->SetXY(42, 22); $X = $pdf->GetX(); $Y = $pdf->GetY(); $pdf->SetFont("Arialb", "", 13); $pdf->Cell(55, 10, utf8_decode("COMMUNE DE FAA'A")); $pdf->SetXY($X + 1, $Y + 8); $pdf->SetFont("Arial", "", 12); $pdf->Cell(55, 5, utf8_decode("N° {$chrono}/DAF/FTR-Régie-hp"), 1, 1, "C"); //$X=$pdf->GetX(); $Y = $pdf->GetY(); $pdf->SetXY($X, $Y); $pdf->SetFont("Arial", "", 9); $pdf->Cell(55, 5, utf8_decode("Affaire suivie par : Hinatini Parker"), 0, 1); $Y = $pdf->GetY(); $pdf->SetXY($X, $Y); $pdf->SetFont("Arial", "", 9); $pdf->Cell(55, 3, utf8_decode("Téléphone : 800 960 poste 421"), 0, 0); ///////////////////////////////////fin en tete///////////////////////////////////// ///////////////////////////////////colonne droite///////////////////////////////// //Date $pdf->SetXY($X + 100, $Y); $pdf->SetFont("Arial", "", 10); $pdf->Cell(55, 3, "Faa'a le " . $today, 0); ///////////////////////////////////fin colonne droite//////////////////////////// /////////////////////////////////info exp/dest ////////////////////////////////////// //Le Maire $pdf->SetY(60); $pdf->SetFont("times", "", 18); $pdf->Cell(0, 10, "Le Maire", 0, 1, "C"); //Destinataire $pdf->SetY(70); $pdf->SetFont("Arial", "", 10); $pdf->Multicell(0, 5, utf8_decode("à\n{$client}\n{$contact}"), 0, "C"); $currentY = $pdf->GetY(); $pdf->SetY($currentY + 10); $pdf->SetFont("Arialb", "U", 10); $pdf->Cell(20, 5, utf8_decode("Objet :"), 0, 0, "L"); $pdf->SetFont("Arialb", "", 10); $pdf->Cell(0, 5, utf8_decode("Relance des factures impayées"), 0, 1, "L"); $pdf->SetFont("Arial", "U", 10); $pdf->Cell(20, 5, utf8_decode("N/Réf :"), 0, 0, "L"); $pdf->SetFont("Arial", "", 10); $pdf->Cell(0, 5, utf8_decode("Facture {$typefacture} N° {$nofacture} du {$datefacture}"), 0, 1, "L"); $Y = $pdf->GetY(); $pdf->SetY($Y + 20); $text = "{$civilite},\n\nJe vous informe que, sauf erreur de ma part, vous présentez un impayé " . "envers la Commune de FAA'A d'un montant de {$montant} FCP au titre de la (des) {$typefacture}.\n\n" . "Aussi, je vous demande de bien vouloir vous rapprocher de la Régie municipale pour vous acquitter de la somme due.\n\n" . "A défaut de réponse de votre part dans un délai de 45 jours à compter de la date du présent courrier," . "votre dossier sera transmis en contentieux à la Trésorerie des Iles du Vent, des Australes et des Archipels pour commandement de payer.\n\n" . "La Régie reste à votre disposition au 800.960 poste 421 pour toute entente préalable avant poursuite.\n\n" . "Je vous prie d'agréer, {$civilite}, l'expression de mes salutations distinguées"; $pdf->Multicell(0, 5, utf8_decode($text), 0, "L"); $pdf->Image("img/marianne.jpg", 150, 220, 31, 31, "jpg"); ////////////////////////////////information//////////////////////////////////// $pdf->Line(20, 273, 190, 273); $pdf->SetXY(20, 273); $pdf->SetFont("Arial", "", 7); $pdf->Cell(0, 3, utf8_decode("PK 4 côté mer - BP 60 002 - 98702 Faa’a Centre - Tahiti / Tél. : (689) 800 960 - Télécopie : (689) 834 890 - E-mail : mairiefaaa@mail.pf\n"), 0, 0, "C"); ////////////////////////////////fin information//////////////////////////////////// $pdf->Output(); }
public function drawPDF() { $pdf = new \FPDF('P', 'mm', 'Letter'); $pdf->SetMargins(0, 3.175, 0); $pdf->SetAutoPageBreak(false); define('FPDF_FONTPATH', dirname(__FILE__) . '/noauto/fonts/'); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php'); $pdf->AddFont('GillBook', '', 'GillSansMTPro-Book.php'); $pdf->SetFont('Gill', '', 16); $data = $this->loadItems(); $count = 0; $sign = 0; $width = 53.975; $height = 68.95999999999999; $top = 20; $left = 5.175; $effective_width = $width - 2 * $left; $pdf->SetDrawColor(0, 0, 0); $pdf->SetLineWidth(0.2); foreach ($data as $item) { if ($count % 16 == 0) { $pdf->AddPage(); // draw tick marks for cutting $pdf->Line(2, $height + 1.5, 6, $height + 1.5); $pdf->Line(2, 2 * $height + 1.5, 6, 2 * $height + 1.5); $pdf->Line(2, 3 * $height + 1.5, 6, 3 * $height + 1.5); $pdf->Line($width, 2, $width, 6); $pdf->Line(2 * $width, 2, 2 * $width, 6); $pdf->Line(3 * $width, 2, 3 * $width, 6); $pdf->Line($width, 4 * $height - 4, $width, 4 * $height); $pdf->Line(2 * $width, 4 * $height - 4, 2 * $width, 4 * $height); $pdf->Line(3 * $width, 4 * $height - 4, 3 * $width, 4 * $height); $pdf->Line(4 * $width - 6, $height + 1.5, 4 * $width - 2, $height + 1.5); $pdf->Line(4 * $width - 6, 2 * $height + 1.5, 4 * $width - 2, 2 * $height + 1.5); $pdf->Line(4 * $width - 6, 3 * $height + 1.5, 4 * $width - 2, 3 * $height + 1.5); $sign = 0; } $row = floor($sign / 4); $column = $sign % 4; $price = $item['normal_price']; if ($item['scale']) { if (substr($price, 0, 1) != '$') { $price = sprintf('$%.2f', $price); } $price .= ' /lb.'; } elseif (isset($item['signMultiplier'])) { $price = $this->formatPrice($item['normal_price'], $item['signMultiplier']); } else { $price = $this->formatPrice($item['normal_price']); } $pdf->Image(dirname(__FILE__) . '/cd_head_16.png', $left - 2 + $width * $column, $top - 17 + $row * $height, $width - 6); $pdf->SetXY($left + $width * $column, $top + $row * $height - 2); $pdf->SetFont('Gill', 'B', $this->SMALL_FONT); $font_shrink = 0; while (true) { $pdf->SetX($left + $width * $column); $y = $pdf->GetY(); $pdf->MultiCell($effective_width, 6, strtoupper($item['brand']), 0, 'C'); if ($pdf->GetY() - $y > 6) { $pdf->SetFillColor(0xff, 0xff, 0xff); $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F'); $font_shrink++; if ($font_shrink >= $this->SMALL_FONT) { break; } $pdf->SetFontSize($this->MED_FONT - $font_shrink); $pdf->SetXY($left + $width * $column, $y); } else { break; } } $pdf->SetX($left + $width * $column); $pdf->SetFont('Gill', '', $this->MED_FONT); $font_shrink = 0; while (true) { $pdf->SetX($left + $width * $column); $y = $pdf->GetY(); $pdf->MultiCell($effective_width, 6, $item['description'], 0, 'C'); if ($pdf->GetY() - $y > 12) { $pdf->SetFillColor(0xff, 0xff, 0xff); $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F'); $font_shrink++; if ($font_shrink >= $this->MED_FONT) { break; } $pdf->SetFontSize($this->MED_FONT - $font_shrink); $pdf->SetXY($left + $width * $column, $y); } else { if ($pdf->GetY() - $y < 12) { $words = explode(' ', $item['description']); $multi = ''; for ($i = 0; $i < floor(count($words) / 2); $i++) { $multi .= $words[$i] . ' '; } $multi = trim($multi) . "\n"; for ($i = floor(count($words) / 2); $i < count($words); $i++) { $multi .= $words[$i] . ' '; } $item['description'] = trim($multi); $pdf->SetFillColor(0xff, 0xff, 0xff); $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F'); $pdf->SetXY($left + $width * $column, $y); $pdf->MultiCell($effective_width, 6, $item['description'], 0, 'C'); } break; } } $pdf->SetX($left + $width * $column); $pdf->SetFont('GillBook', '', $this->SMALLER_FONT); $item['size'] = strtolower($item['size']); if (substr($item['size'], -1) != '.') { $item['size'] .= '.'; // end abbreviation w/ period $item['size'] = str_replace('fz.', 'fl oz.', $item['size']); } if (substr($item['size'], 0, 1) == '.') { $item['size'] = '0' . $item['size']; // add leading zero on decimal qty } if (strlen(ltrim($item['upc'], '0')) < 5 && $item['scale']) { $item['size'] = 'PLU# ' . ltrim($item['upc'], '0'); // show PLU #s on by-weight } $pdf->Cell($effective_width, 6, $item['size'], 0, 1, 'C'); $pdf->SetXY($left + $width * $column, $top + $height * $row + ($height - $top - 18)); $pdf->SetFont('Gill', '', $this->BIG_FONT); $pdf->MultiCell($effective_width, 10, $price, 0, 'C'); if ($item['startDate'] != '' && $item['endDate'] != '') { // intl would be nice $datestr = date('M d', strtotime($item['startDate'])) . chr(0x96) . date('M d', strtotime($item['endDate'])); $pdf->SetXY($left + $width * $column, $top + $height * $row + ($height - $top - 7)); $pdf->SetFont('GillBook', '', $this->SMALLEST_FONT); $pdf->Cell($effective_width + 4, 6, strtoupper($datestr), 0, 1, 'R'); } if ($item['upc'] != '') { $pdf->SetXY($left - 2 + $width * $column, $top + $height * $row + ($height - $top - 7)); $pdf->SetFont('GillBook', '', $this->SMALLEST_FONT); $pdf->Cell($effective_width, 6, $item['upc'], 0, 1, 'L'); } $pdf->Image(dirname(__FILE__) . '/' . $this->footer_image, $left - 2 + $width * $column, $top + $height * $row + ($height - $top - 2), $width - 6); $count++; $sign++; } $pdf->Output('Signage16UpP.pdf', 'I'); }
function generatePDF($print_id, $print_type = 1) { include "config.php"; require_once 'fpdf/fpdf.php'; $db = go\DB\DB::create($db_params, 'mysql'); $db->query('SET CHARACTER SET cp1251'); $get_print = $db->query('SELECT `finish_number`, `valve_type_id` FROM {numbers} WHERE `print_id`=?', array($_GET['print_id']))->assoc(); $get_print_info = $db->query('SELECT DISTINCT(`nm`.`order`) as `order`, `us`.`name` as `name`, `nm`.`print_id` as `print_id` FROM {numbers} `nm` LEFT JOIN {users} `us` ON (`nm`.`user_id` = `us`.`id`) WHERE `print_id`=?', array($_GET['print_id']))->row(); define('FPDF_FONTPATH', 'fpdf/fonts'); $pdf = new FPDF("L", "mm", array("88", "7")); $pdf->AddFont('Arial-BoldMT', 'B', 'arial_bold.php'); $pdf->SetFont('Arial-BoldMT', 'B', 11); $pdf->SetTextColor(0); //Add info for this order $pdf->AddPage('L'); $pdf->SetAutoPageBreak(false); $pdf->SetXY(0, 0); $pdf->Cell(43, 7, $get_print_info['name'], 0, 0, "C", 0); $pdf->Cell(4, 7, '', 0, 0, "C", 0); $pdf->Cell(43, 7, $get_print_info['order'], 0, 0, "C", 0); //End of add for ($i = 0; $i < count($get_print); $i++) { $pdf->AddPage('L'); $pdf->SetAutoPageBreak(false); $pdf->SetXY(0, 0); $pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i]['finish_number'], 0, 0, "C", 0); $pdf->Cell(4, 7, '', 0, 0, "C", 0); if ($i + $print_type < count($get_print)) { $pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i + $print_type]['finish_number'], 0, 0, "C", 0); } $pdf->SetAutoPageBreak(false); $i += $print_type; } return $pdf->Output($get_print_info['print_id'] . '.pdf', 'I'); }
public function post_id_handler() { if (!is_array($this->id)) { $this->id = array($this->id); } $today = date("F j, Y"); $pdf = new FPDF('L', 'in', array(3.5, 5.0)); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $primary = ""; $pdf->SetAutoPageBreak(true, 0); $pdf->SetFont("Gill", "", 10); //Meat of the statement foreach ($this->id as $card_no) { $account = \COREPOS\Fannie\API\member\MemberREST::get($card_no); $pdf->AddPage(); $pdf->SetXY(3.0, 1.45); foreach ($account['customers'] as $c) { if ($c['accountHolder']) { $pdf->Cell(2, 0.25, $c['firstName'] . ' ' . $c['lastName'], "", 1, "L"); break; } } $pdf->SetX(3.0); $pdf->Cell(2, 0.25, $account['addressFirstLine'], "", 1, "L"); if ($account['addressSecondLine']) { $pdf->SetX(3.0); $pdf->Cell(2, 0.25, $account['addressSecondLine'], "", 1, "L"); } $pdf->SetX(3.0); $str = $account['city'] . ", " . $account['state'] . " " . $account['zip']; $pdf->Cell(2, 0.25, $str, "", 1, "L"); } $pdf->Output('member postcards.pdf', 'D'); return false; }
function UsersTrafficPeriodPDF() { //require('chart.php'); require 'lib/fpdf.php'; global $SAMSConf; global $DATE; $DB = new SAMSDB(); $sdate = $DATE->sdate(); $edate = $DATE->edate(); $bdate = $DATE->BeginDate(); $eddate = $DATE->EndDate(); $size = ""; if (isset($_GET["size"])) { $size = $_GET["size"]; } require "reportsclass.php"; $dateselect = new DATESELECT($DATE->sdate(), $DATE->edate()); $lang = "./lang/lang.{$SAMSConf->LANG}"; require $lang; define('FPDF_FONTPATH', 'lib/font/'); require 'lib/fpdf.php'; $pdfFile = new FPDF(); $pdfFile->Open(); $pdfFile->AddFont('Nimbus', '', 'Nimbus.php'); $pdfFile->SetAuthor("SQUID Account Management System"); $pdfFile->SetCreator("Created by SAMS2"); $pdfFile->SetTitle("SAMS2 users statistic"); // UsersTrafficPeriodPDF(); $pdfFile->AddPage(); $pdfFile->SetFont('Nimbus', '', 15); //$pdfFile->SetFont('SUSESerif-Roman','',16); $pdfFile->SetXY(50, 15); echo " {$usersbuttom_2_traffic_UsersTrafficPeriod_1}<BR>{$usersbuttom_2_traffic_UsersTrafficPeriod_2}<br>"; $pdfFile->Write(0, " {$usersbuttom_2_traffic_UsersTrafficPeriod_1}<BR>{$usersbuttom_2_traffic_UsersTrafficPeriod_2}"); $pdfFile->Output(); }
$newapp = $app; } } $appfinal = date("Y - m") . " - " . $newapp; $date = date("m/d/Y"); $mysqli->query("UPDATE tbl_applicant SET \n\t\t\t\t\tapplicantVoucherCode = '{$appfinal}'\n\t\t\t\t\tWHERE applicantId = '{$app}' \n\t\t\t\t\t"); $resultInfo = mysql_query("SELECT content_agencyName ,content_agencyAddress, content_pdfagencyName FROM tbl_content WHERE contentId = 1\n\t\t\t\t\t\t\t\t"); while ($rowInfo = mysql_fetch_array($resultInfo)) { $AgencyName = $rowInfo['content_agencyName']; $AgencyAddress = $rowInfo['content_agencyAddress']; $pdfAgencyName = $rowInfo['content_pdfagencyName']; } //while $pdf = new FPDF('p', 'mm', 'A4'); $pdf->AddPage(); $pdf->AddFont('BarcodeFont', '', 'BarcodeFont.php'); $pdf->AddFont('Calibri', '', 'Calibri.php'); $pdf->AddFont('Calibri Bold', '', 'Calibri Bold.php'); $pdf->SetFont('Calibri Bold', '', 11); $pdf->SetX(16); $pdf->Cell(56, 6, $pdfAgencyName, 0, 0, 'L', FALSE); $pdf->SetY(9); $pdf->SetX(16); $pdf->SetFont('Calibri', '', 11); $pdf->SetTextColor(144, 141, 141); $pdf->Cell(10, 20, 'Powered by getchs;', 0, 0, 'L', FALSE); $pdf->SetY(18); $pdf->SetX(148); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('BarcodeFont', '', 54); $pdf->Cell(108, 25, $appfinal, 0, 'R', FALSE);
$fgk = getFluggeldkontoPdf($data); $data = $fgk['flugbuch']; $saldo_ende = getFluggeldkontoSaldo($mitglied['acb_nr'], $_POST['zeitraum_monat'], $_POST['zeitraum_jahr']); $saldo_anfang = $saldo_ende - $fgk['umsatz']; // die notwendigen Information zum Speichern der Konten- // salden ermitteln und in das Array zur Übergabe speichern $params = array('acb_nr' => $mitglied['acb_nr'], 'zyklus' => sprintf('%s%s', $_POST['zeitraum_jahr'], $_POST['zeitraum_monat']), 'jahr' => $_POST['zeitraum_jahr'], 'monat' => $_POST['zeitraum_monat'], 'saldo_anfang' => $saldo_anfang, 'saldo_ende' => $saldo_ende); // die aktuellen Kontensalden für den Mitglied speichern setMonatssalden($params); // ******************************************************** SEITE ******************************************************** // // Seite hinzufügen $pdf->AddPage(); $pdf_all->AddPage(); // Schriftart hinzufügen $pdf->AddFont('Arial Narrow', '', 'c0bd260bcc2709f99785311b28a9541f_arialn.php'); $pdf_all->AddFont('Arial Narrow', '', 'c0bd260bcc2709f99785311b28a9541f_arialn.php'); // Kopfzeile auf der aktuellen Seite hinzufügen pdf_header($pdf, $mitglied); pdf_header($pdf_all, $mitglied); $y = 35; $flugzeit_gesamt = 0.0; $flugzeit_pilot = 0.0; $flugzeit_starts = 0; $first = 0; foreach ($data as $zeile) { // aktuellen Eintrag, separiert per Semikolon, // splitten und anschließend als Array wiedergeben $item = explode(';', $zeile); $pdf->SetXY(20, $y); $pdf_all->SetXY(20, $y); // Schriftgrad einstellen
$this->Ln(40); } function Footer() { // Positionnement à 1.5cm du bas $this->SetY(-15); // Adresse $this->Cell(196, 5, 'Projet Champagne', 0, 0, 'C'); } } // Instanciation de la classe PDF $pdf = new FPDF('P', 'mm', 'A4'); $pdf->AddPage(); $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true); $pdf->SetFont('DejaVu', '', 12); $pdf->SetTextColor(0); // Infos de la commande calées à gauche $pdf->Text(20, 80, 'N° de facture : '.$tCommande[0]['id']); $pdf->Text(20, 85, 'N° de client : '.$tCommande[0]['idClient']); // Infos du client calées à droite $pdf->Text(120, 50, $tClient['nomClient'].' '.$tClient['prenomClient']); $pdf->Text(120, 55, $tClient['adresseClient']); $pdf->Text(120, 60, $tClient['cpClient'].' '.$tClient['villeClient']); // Infos date $pdf->Text(120, 80, 'Buire, le '.date("d-m-Y", strtotime($tCommande[0]['dateFacture'])));
<?php require_once 'fpdf.php'; define('FPDF_FONTPATH', './font/'); //Zeichensatz anzeigen im PDF $font = 'ORION'; $pdf = new FPDF(); $pdf->AddFont($font, '', $font . '.php'); $pdf->SetFont($font, '', 15); $pdf->Open(); $pdf->AddPage(); $pdf->setFontSize(15); for ($i = 32; $i < 256; $i++) { $text .= " #{$i}: " . chr($i); } $pdf->write(10, $text); $pdf->output('test.pdf');
<?php require_once "../config.php"; define('FPDF_FONTPATH', 'font/'); require '../fpdf.php'; $pdf = new FPDF(); // เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวธรรมดา กำหนด ชื่อ เป็น angsana $pdf->AddFont('angsana', '', 'angsa.php'); // เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวหนา กำหนด ชื่อ เป็น angsana $pdf->AddFont('angsana', 'B', 'angsab.php'); // เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวหนา กำหนด ชื่อ เป็น angsana $pdf->AddFont('angsana', 'I', 'angsai.php'); // เพิ่มฟอนต์ภาษาไทยเข้ามา ตัวหนา กำหนด ชื่อ เป็น angsana $pdf->AddFont('angsana', 'BI', 'angsaz.php'); //สร้างหน้าเอกสาร $pdf->AddPage(); // กำหนดฟอนต์ที่จะใช้ อังสนา ตัวธรรมดา ขนาด 12 //$pdf->SetFont('angsana','',12); // พิมพ์ข้อความลงเอกสาร //$pdf->setXY( 10, 10 ); //$pdf->MultiCell( 0 , 0 , iconv( 'UTF-8','cp874' , 'อังสนา ตัวธรรมดา ขนาด 12' ) ); /*$pdf->SetFont('angsana','B',16); $pdf->setXY( 10, 20 ); $pdf->MultiCell( 0 , 0 , iconv( 'UTF-8','cp874' , 'อังสนา ตัวหนา ขนาด 16' ) ); */ /*$pdf->SetFont('angsana','I',24); $pdf->setXY( 10, 30 ); $pdf->MultiCell( 0 , 0 , iconv( 'UTF-8','cp874' , 'อังสนา ตัวเอียง ขนาด 24' ) ); */ /*$pdf->SetFont('angsana','BI',32); $pdf->setXY( 10, 40 );
public function insert_font() { require_once Kohana::find_file('vendor/html2pdf/fpdf', 'fpdf'); $pdf = new FPDF(); $pdf->AddFont('english_mt', '', 'english_mt.php'); $pdf->AddPage(); $pdf->SetFont('english_mt', '', 35); $pdf->Write(10, 'Changez de police avec FPDF !'); $pdf->Output(); die; }
#!/usr/bin/php <?php require '../fpdf/fpdf.php'; define('FPDF_FONTPATH', '../fpdf/'); // ironically, in order to use international characters with FPDF, // the file must be saved with the ISO-8859-15 encoding, not unicode // to test, on the command line run: // ./test.php > test.pdf $pdf = new FPDF('P', 'in', 'Letter'); $pdf->AddFont('DejaVuSerif'); $pdf->SetFont('DejaVuSerif', '', 16); $pdf->AddPage(); // with apologies to sam ruby (http://intertwingly.net/stories/2004/04/14/i18n.html) $text = "Iñtërnâtiônàlizætiøn"; $pdf->Cell(2, 2, $text); $pdf->Output();
function geraCertificado($Data, $NomeAluno, $Evento, $orador, $CargaHoraria, $organizadorEvento, $caminhoServidor) { //CRIA O PDF $pdf = new FPDF(); $pdf->SetTitle('Certificado de ' . utf8_decode($NomeAluno)); // ABRE O PDF PARA EDIÇÃO $pdf->Open(); // ADICIONA UMA PÁGINA AO ARQUIVO $pdf->AddPage('L', 'A4'); $pdf->AddFont('Century', '', 'Century.php'); // ADICIONA IMAGEM (CABEÇALHO) $pdf->Image('resources/images/header.png', 0, 5); $pdf->SetY(67); $pdf->SetX(20); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Century', '', 18); if ($orador != "") { $pdf->MultiCell(220, 10, utf8_decode("Certifico para os devidos fins que {$NomeAluno} participou, como ouvinte, do evento \"{$Evento}\" apresentado por \"{$orador}\" organizado pelo(a) {$organizadorEvento}, {$Data} com carga horária de {$CargaHoraria} horas."), 0, "J", false); } else { $pdf->MultiCell(220, 10, utf8_decode("Certifico para os devidos fins que {$NomeAluno} participou, como ouvinte, do evento \"{$Evento}\" organizado pelo(a) {$organizadorEvento}, {$Data} com carga horária de {$CargaHoraria} horas."), 0, "J", false); } //ADICIONA A ASSINATURA $pdf->Image('resources/images/assinaturaFulano.gif', 125, 130, 43, 16); //NOME DO ASSINANTE $pdf->SetFont('Century', '', 12); $pdf->SetY(157); $pdf->SetX(73); $pdf->Cell(145, 0, 'Sr. Fulano da Silva', 0, 0, 'C'); //TITULO OU FUNCAO DO ASSINANTE $pdf->ln(7); $pdf->SetX(73); $pdf->Cell(145, 0, utf8_decode("Título/Função de Fulano da Silva"), 0, 0, 'C'); //ENDEREÇO DO LOCAL A DESEJAR $pdf->SetY(175); $pdf->ln(4); $pdf->SetX(73); $pdf->Cell(145, 0, utf8_decode("Avenida Meu Endereço, São Paulo - SP"), 0, 0, 'C'); //RODAPE COM DEMAIS INFORMACOES $pdf->ln(7); $pdf->SetX(73); $pdf->Cell(145, 0, '(11) 5555-5555 - www.seusite.com.br', 0, 0, 'C'); //GERA O ARQUIVO PDF COM O NOME DO ALUNO E SALVA NO SERVIDOR EM PASTA ESPECIFICA DO EVENTO $NomeAlunoSemAcent = remove_acentuacao($NomeAluno, true); $EventoSemAcent = remove_acentuacao($Evento, true); $pdf->Output($caminhoServidor . "/{$EventoSemAcent}/" . $NomeAlunoSemAcent . ".pdf", "F"); }
/** * Render a single-line text field to the PDF * * @since 1.0 * @param FPDF $fpdf fpdf library object * @param string $field_name the field name * @param mixed $value string or int value to display * @param int $show_border a debugging/helper option to display a border * around the position for this field * @param string $align optional text alignment. Defaults to 'L' for left-justified, but can also be 'R' for right-justified or 'C' for center-justified */ public function text_field($fpdf, $field_name, $value, $show_border, $align = 'L') { if ($this->get_field_position($field_name) && $value) { $font = $this->get_field_font($field_name); // get the field position list($x, $y, $w, $h) = array_map(array($this, 'convert_pixels_to_points'), array_values($this->get_field_position($field_name))); // font color $font['color'] = $this->hex2rgb($font['color']); $fpdf->SetTextColor($font['color'][0], $font['color'][1], $font['color'][2]); // set the field text styling $font_path = "/" . strtolower($font['family'] . $font['style'] . ".php"); $fpdf->AddFont($font['family'], $font['style'], $font_path); $fpdf->SetFont($font['family'], $font['style'], $font['size']); // show a border for debugging purposes if ($show_border) { $fpdf->setXY($x, $y); $fpdf->Cell($w, $h, '', 1); } // align the text to the bottom edge of the cell by translating as needed $y = $font['size'] > $h ? $y - ($font['size'] - $h) / 2 : $y + ($h - $font['size']) / 2; // handle right/center justification, it's left-justified by default so nothing to do in that case if ('R' == $align) { $x = max(0, $x + ($w - $fpdf->GetStringWidth($value))); } elseif ('C' == $align) { $x = max(0, $x + ($w - $fpdf->GetStringWidth($value)) / 2); } $fpdf->setXY($x, $y); // and write out the value $fpdf->Cell($w, $h, utf8_decode($value)); // can try iconv('UTF-8', 'windows-1252', $value); if this doesn't work correctly for accents } }
include $maindir . 'Datos/conexion.php'; include $maindir . "conexion/config.inc.php"; $identi = NULL; $pfecha = NULL; $tipoSolicitud = NULL; if (isset($_SESSION["N_IDENTIDAD"])) { $identi = $_SESSION["N_IDENTIDAD"]; } if (isset($_SESSION["FECHA"])) { $pfecha = $_SESSION["FECHA"]; } if (isset($_SESSION["TIPO_SOLICITUD"])) { $tipoSolicitud = $_SESSION["TIPO_SOLICITUD"]; } $pdf = new FPDF('P', 'mm', array(215.9, 330.2)); $pdf->AddFont('Calibri', 'B', 'calibrib.php'); $pdf->AddFont('Cambria', 'BI', 'cambriaz.php'); $pdf->AddFont('Cambria', 'I', 'cambriai.php'); $pdf->AddFont('Cambria', 'B', 'cambriab.php'); $pdf->AddFont('Cambria', '', 'Cambria.php'); $pdf->AddPage(); $pdf->SetFont('Arial', '', 18); $pdf->Image($maindir . 'assets/img/Encabezado de documentos.jpg', 4.0, 0.5, 209.6, 32.2, 'JPG'); $pdf->Image($maindir . "assets/img/Pie de documentos.jpg", 4.0, 191, 208.8, 137, 'JPG'); $pdf->SetRightMargin(15); $pdf->SetLeftMargin(15); $pdf->SetFont('Calibri', 'B', 11); $pdf->Cell(0, -4.5, utf8_decode("FACULTAD DE CIENCIAS JURÍDICAS"), 0, 0, 'R'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, 0, utf8_decode("Teléfono: 2232-2290"), 0, 1, 'R');
session_start(); if (isset($_SESSION['cc'])) { //provider for book pages $p = new EPListProvider('../../../php/config.ini'); $pdf = new FPDF(); $morphs = $_SESSION['cc']->getCurrentMorphs(); //PDF EXPORT ================================================================ //EGO ================================================================ $pdf->AddPage('P', 'A4'); //A4 EGO PAGE $searchpath = dirname(dirname(dirname(__FILE__))); //."/input"; //SET BAGROUNT PNG----------------------------- $pdf->Image($searchpath . "/version4/exporter/EP_BCK_PDF_EGO.png", 0, 0, -150); //DEFINE FONTS --------------------------------- $pdf->AddFont('Lato-Lig', '', 'Lato-Lig.php'); $pdf->AddFont('Lato-LigIta', '', 'Lato-LigIta.php'); $pdf->AddFont('Lato-Reg', '', 'Lato-Reg.php'); $pdf->SetFont('Lato-Lig', '', 10); //BEGIN FILLING SHEET------------------------------ $character = $_SESSION['cc']->character; //NAMES $pdf->Text(60, 12, $character->charName); //Character Name $pdf->Text(143, 12, $character->playerName); //Player Name //ORIGINES $pdf->Text(37, 26, formatIt($_SESSION['cc']->getCurrentBackground()->name)); //Background $pdf->Text(37, 33, formatIt($_SESSION['cc']->getCurrentFaction()->name)); //Faction
public function drawPDF() { $pdf = new \FPDF('P', 'mm', 'Letter'); if (\COREPOS\Fannie\API\FanniePlugin::isEnabled('CoopDealsSigns')) { $this->font = 'Gill'; $this->alt_font = 'GillBook'; define('FPDF_FONTPATH', dirname(__FILE__) . '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/'); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php'); } $width = 52; // tag width in mm $height = 31; // tag height in mm $left = 6; // left margin $top = 16; // top margin $pdf->SetTopMargin($top); //Set top margin of the page $pdf->SetLeftMargin($left); //Set left margin of the page $pdf->SetRightMargin($left); //Set the right margin of the page $pdf->SetAutoPageBreak(False); // manage page breaks yourself $data = $this->loadItems(); $num = 0; // count tags $x = $left; $y = $top; foreach ($data as $item) { // extract & format data $price = $item['normal_price']; $desc = strtoupper(substr($item['posDescription'], 0, 25)); $brand = ucwords(strtolower(substr($item['brand'], 0, 13))); $pak = $item['units']; $size = $item['units'] . "-" . $item['size']; $sku = $item['sku']; $ppu = $item['pricePerUnit']; $vendor = substr($item['vendor'], 0, 7); $upc = $item['upc']; if ($num % 32 == 0) { $pdf->AddPage(); $x = $left; $y = $top; } else { if ($num % 4 == 0) { $x = $left; $y += $height; } } $pdf->SetFont($this->font, '', 8); $pdf->SetXY($x, $y); // try normal wordwrap // but squeeze into two lines if needed $wrapped = wordwrap($desc, 12, "\n", true); if (count(explode("\n", $wrapped)) > 2) { $wrapped = substr($desc, 0, 12); if ($wrapped[11] != ' ') { $wrapped .= '-'; } $wrapped .= "\n"; $wrapped .= trim(substr($desc, 12)); } $pdf->MultiCell($width / 2, 3, $wrapped, 0, 'L'); $pdf->SetX($x); $pdf->Cell($width / 2, 3, date('n/j/y ') . $size, 0, 1, 'L'); $pdf->SetFont($this->font, 'B', 18); //change font for price $pdf->SetX($x); $pdf->Cell($width / 2, 8, $price, 0, 1, 'L'); $args = array('height' => 7, 'align' => 'L', 'fontsize' => 8, 'width' => 0.23, 'font' => $this->font); $b_y = $pdf->GetY(); $pdf = $this->drawBarcode($upc, $pdf, $x, $b_y, $args); // move right by tag width $x += $width; $num++; } $pdf->Output('Tags4x8P.pdf', 'I'); }
$worksheet->write($n, 6, '', $fmtMB); $worksheet->write($n, 7, '', $fmtMB); $worksheet->write($n, 8, '', $fmtMB); $worksheet->write($n, 9, '', $fmtMB); ++$n; } } $workbook->close(); if ($table_post || $table_post_our) { $zip = new ZipArchive(); $zip->open("/tmp/{$sid}postdocs.zip", ZIPARCHIVE::CREATE); if ($envelopes) { $n = 1; foreach ($envelopes as $letter) { $pdf = new FPDF('L', 'mm', 'A4'); $pdf->AddFont('TimesNewRomanPSMT', '', '5f37f1915715e014ee2254b95c0b6cab_times.php'); $pdf->SetFont('TimesNewRomanPSMT', '', 12); $pdf->SetTextColor(0, 0, 0); $pdf->AddPage('L'); $pdf->SetXY(197, 145); $pdf->SetDrawColor(50, 60, 100); $pdf->MultiCell(65, 6, 'Кому: ' . html_entity_decode($letter['user']) . "\nКуда: " . html_entity_decode($letter['address']), 0, 'L'); $pdf->Output("/tmp/{$sid}-{$n}letters.pdf", 'F'); ++$n; } $pdf = new FPDI(); $pagecount = 1; $n = 1; foreach ($envelopes as $letter) { $pagecount = $pdf->setSourceFile("/tmp/{$sid}-{$n}letters.pdf"); $tplidx = $pdf->importPage($pagecount, '/MediaBox');
public function post_id_handler() { $numbers = array("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty"); if (!is_array($this->id)) { $this->id = array($this->id); } $today = date("F j, Y"); $pdf = new FPDF('P', 'mm', 'Letter'); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Medium.php'); //Meat of the statement foreach ($this->id as $card_no) { $pdf->AddPage(); $pdf->Image('new_letterhead_horizontal.png', 5, 10, 200); $pdf->SetFont('Gill', '', '12'); $pdf->Ln(45); $account = \COREPOS\Fannie\API\member\MemberREST::get($card_no); $pdf->Cell(10, 10, $today, 0); $pdf->Ln(15); foreach ($account['customers'] as $c) { if ($c['accountHolder']) { $firstname = ucwords(strtolower($c['firstName'])); $lastname = ucwords(strtolower($c['lastName'])); $fullname = $firstname . " " . $lastname; break; } } //Member address $pdf->Cell(10, 10, trim($fullname), 0); $pdf->Ln(5); $pdf->Cell(80, 10, $account['addressFirstLine'], 0); if ($account['addressSecondLine']) { $pdf->Cell(80, 10, $account['addressSecondLine'], 0); } $pdf->Cell(90, 10, $account['city'] . ', ' . $account['state'] . ' ' . $account['zip'], 0); $pdf->Ln(15); $pdf->MultiCell(0, 5, "Dear " . $firstname . ","); $pdf->Ln(5); $txt = "We have received your Application to Terminate your membership at WFC. The\nBoard reviews termination requests annually in "; $pdf->SetFont("Gill", "", "12"); $pdf->Write(5, str_replace("\n", " ", $txt)); $pdf->SetFont("Gill", "B", "12"); $pdf->Write(5, "February"); $pdf->SetFont("Gill", "", "12"); $txt = ". Refunds, less any indebtedness owed to WFC, are authorized for payment in\nthe order received subject to the financial health of WFC and receipt of additional stock\nfrom new members. Your stock will be refunded as soon as possible based on these criteria."; $pdf->Write(5, str_replace("\n", " ", $txt) . "\n"); $pdf->Ln(5); $txt = "Submission of an Application to Terminate immediately inactivates your owner\nbenefits and discounts and your right to participate in governance of WFC. Please keep us\nadvised of any changes in your mailing address."; $pdf->MultiCell(0, 5, str_replace("\n", ' ', $txt)); $pdf->Ln(5); $txt = "If you have any questions, please do not hesitate to ask. I can be reached at the\nnumber above or at mms@wholefoods.coop. Thank you."; $pdf->MultiCell(0, 5, str_replace("\n", ' ', $txt)); $pdf->Ln(5); $pdf->MultiCell(0, 5, "Thank you for your support of WFC"); $pdf->Ln(10); $pdf->MultiCell(0, 5, "Sincerely yours,"); $pdf->MultiCell(0, 5, "WHOLE FOODS COMMUNITY CO-OP, INC."); $pdf->Ln(10); $pdf->MultiCell(0, 5, "Amanda Borgren"); $pdf->MultiCell(0, 5, "Owner Services"); } $pdf->Output('member term letters.pdf', 'D'); return false; }
$row_sign = mysqli_fetch_array($result_sign); $name = $row_sign['name']; $position1 = $row_sign['position1']; $position1 = thainumDigit($position1); $position2 = $row_sign['position2']; $position2 = thainumDigit($position2); $sign_pic = $row_sign['sign_pic']; if ($sign_pic != "") { $sign_pic = "../sign_picture/" . $sign_pic; } else { $sign_pic = "image/chinpat.jpg"; } /////////////////////////////////////// $pdf = new FPDF('L', 'mm', 'A4'); $pdf->AddPage(); $pdf->AddFont("AngsanaNew", "", "angsa.php"); $pdf->AddFont("AngsanaNew", "B", "angsab.php"); $pdf->AddFont("AngsanaNew", "I", "angsai.php"); $pdf->Image('image/bg.jpg', 0, 0, 297, 210); $pdf->Image('image/obec.jpg', 133, 10, 30, 0); $pdf->Ln(7); $pdf->SetFont("AngsanaNew", "", 20); $pdf->Cell(0, 7, "{$number_text}", 0, 0, 0, 0); $pdf->Ln(28); $pdf->SetFont("AngsanaNew", "B", 35); $pdf->Cell(0, 30, "{$office}", 0, 1, 'C'); $pdf->Ln(1); $pdf->SetFont("AngsanaNew", "B", 30); $pdf->Cell(0, 5, "���õԺѵé�Ѻ��������������ʴ����", 0, 1, 'C'); $pdf->Ln(8); $pdf->SetFont("AngsanaNew", "B", 30);
//recuperation de la liste des ateliers en attente $db = mysqli_connect($host, $userdb, $passdb, $database); $sql = "SELECT rel_session_user.`id_session`,`session_titre`,`session_detail`\nFROM `rel_session_user`,tab_session,tab_session_sujet\nWHERE `id_user` ='" . $user . "'\nAND tab_session.`id_session`=rel_session_user.`id_session`\nAND `status_rel_session` =2\nAND `status_session` =0\nAND tab_session_sujet.`id_session_sujet`= tab_session.nom_session\nGROUP BY rel_session_user.`id_session` "; $rowsessionattente = mysqli_query($db, $sql); mysqli_close($db); if (mysqli_num_rows($rowsessionattente) == 0) { $attente = 0; } else { $nba = mysqli_num_rows($rowsessionattente); $attente = 1; } ///**********ECRITURE DU COURRIER /* initialisation/configuration de la classe*/ $courrier = new FPDF(); //font declaration des polices ! $courrier->AddFont('SourceSansPro-Regular', '', 'SourceSansPro-Regular.php'); $courrier->AddFont('SourceSansPro-Semibold', '', 'SourceSansPro-Semibold.php'); $courrier->AddFont('SourceSansPro-LightItalic', '', 'SourceSansPro-LightItalic.php'); $courrier->SetFont('SourceSansPro-Regular', '', 12); $courrier->open(); $courrier->SetAutoPageBreak(1, 15); $courrier->AddPage(); /* Création bloc emetteur */ $courrier->SetFont('SourceSansPro-Regular', '', 12); $courrier->Image($logo, 5, 10, 45, 27); $courrier->Ln(20); $courrier->SetXY(55, 15); $courrier->Cell(0, 5, $emetteur['nom'], 0, 2, 'L', false); //largeur,hauteur,,texte,bodure,suite,alignement,couleur de fond; $courrier->SetX(55); $courrier->MultiCell(0, 5, $emetteur['adr'], 0, 'L', false);
} if ($_POST["year"] != '') { $_SESSION['year'] = $_POST["year"]; } if ($_POST["search_study_type"] == 'Денна') { $study_type = "stc"; } if ($_POST["search_study_type"] == 'Заочна') { $study_type = "zao"; } $pdf = new FPDF(); //set document properties $pdf->SetAuthor('Alexandr Slovinskiy'); $pdf->SetTitle('Order Annex'); //set font for the entire document $pdf->AddFont('Times', '', 'times.php'); $pdf->SetFont('Times', ''); $pdf->SetTextColor(0, 0, 0); //set up a page $pdf->AddPage('L'); $pdf->SetDisplayMode(real, 'default'); //display the title with a border around it //Set x and y position for the main text, reduce font size and write content $pdf->Image('img/form_1-12-2.jpg', 10, 15, 280); $pdf->SetFontSize(9); $pdf->SetXY(261, 29.5); $pdf->Write(5, $_POST["order_number"]); $pdf->SetXY(197.5, 37); $pdf->Write(5, $_POST["day"]); $pdf->SetXY(205, 37); $pdf->Write(5, $_POST["month"]);
public function drawPDF() { $pdf = new \FPDF('L', 'mm', 'Letter'); $pdf->SetMargins(3.175, 3.175, 3.175); $pdf->SetAutoPageBreak(false); define('FPDF_FONTPATH', dirname(__FILE__) . '/noauto/fonts/'); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php'); $pdf->AddFont('GillBook', '', 'GillSansMTPro-Book.php'); $pdf->SetFont('Gill', '', 16); $data = $this->loadItems(); $count = 0; $sign = 0; $width = 68.67; $height = 71; $top = 22; $left = 6.0; $effective_width = $width - $left; foreach ($data as $item) { if ($count % 12 == 0) { if ($count != 0) { // draw tick marks again // sometimes other content of the page // overwrites them $pdf->Line(2, $height + 0.0, 6, $height + 0.0); $pdf->Line(2, 2 * $height + 1.0, 6, 2 * $height + 1.0); $pdf->Line(4 * $width - 3, $height + 0.0, 4 * $width + 1, $height + 0.0); $pdf->Line(4 * $width - 3, 2 * $height + 1.0, 4 * $width + 1, 2 * $height + 1.0); $pdf->Line($width + 1.5, 2, $width + 1.5, 8); $pdf->Line(2 * $width + 1.5, 2, 2 * $width + 1.5, 8); $pdf->Line(3 * $width + 1.5, 2, 3 * $width + 1.5, 8); $pdf->Line($width + 1.5, 3 * $height - 6, $width + 1.5, 3 * $height); $pdf->Line(2 * $width + 1.5, 3 * $height - 6, 2 * $width + 1.5, 3 * $height); $pdf->Line(3 * $width + 1.5, 3 * $height - 6, 3 * $width + 1.5, 3 * $height); } $pdf->AddPage(); // draw tick marks for cutting $pdf->Line(2, $height + 0.0, 6, $height + 0.0); $pdf->Line(2, 2 * $height + 1.0, 6, 2 * $height + 1.0); $pdf->Line(4 * $width - 3, $height + 0.0, 4 * $width + 1, $height + 0.0); $pdf->Line(4 * $width - 3, 2 * $height + 1.0, 4 * $width + 1, 2 * $height + 1.0); $pdf->Line($width + 1.5, 2, $width + 1.5, 8); $pdf->Line(2 * $width + 1.5, 2, 2 * $width + 1.5, 8); $pdf->Line(3 * $width + 1.5, 2, 3 * $width + 1.5, 8); $pdf->Line($width + 1.5, 3 * $height - 6, $width + 1.5, 3 * $height); $pdf->Line(2 * $width + 1.5, 3 * $height - 6, 2 * $width + 1.5, 3 * $height); $pdf->Line(3 * $width + 1.5, 3 * $height - 6, 3 * $width + 1.5, 3 * $height); $sign = 0; } $row = floor($sign / 4); $column = $sign % 4; $price = $item['normal_price']; if ($item['scale']) { if (substr($price, 0, 1) != '$') { $price = sprintf('$%.2f', $price); } $price .= ' /lb.'; } elseif (isset($item['signMultiplier'])) { $price = $this->formatPrice($item['normal_price'], $item['signMultiplier']); } else { $price = $this->formatPrice($item['normal_price']); } $pdf->Image(dirname(__FILE__) . '/cd_head_16.png', $left - 1 + $width * $column, $top - 19 + $row * $height, $width - 6); $pdf->SetXY($left + $width * $column, $top + $row * $height + 1); $pdf->SetFont('Gill', 'B', $this->SMALL_FONT); $pdf->MultiCell($effective_width, 6, strtoupper($item['brand']), 0, 'C'); /** This block attempts to write the description then checks how many lines it took. If the description was longer than two lines, it whites the whole thing out, drops one font size, and tries again. Calculating effective text size with smart line breaks seems really tough. */ $pdf->SetFont('Gill', '', $this->MED_FONT); $font_shrink = 0; while (true) { $pdf->SetX($left + $width * $column); $y = $pdf->GetY(); $pdf->MultiCell($effective_width, 7, $item['description'], 0, 'C'); if ($pdf->GetY() - $y > 14) { $pdf->SetFillColor(0xff, 0xff, 0xff); $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F'); $font_shrink++; if ($font_shrink >= $this->MED_FONT) { break; } $pdf->SetFontSize($this->MED_FONT - $font_shrink); $pdf->SetXY($left + $width * $column, $y); } else { if ($pdf->GetY() - $y < 14) { $words = explode(' ', $item['description']); $multi = ''; for ($i = 0; $i < floor(count($words) / 2); $i++) { $multi .= $words[$i] . ' '; } $multi = trim($multi) . "\n"; for ($i = floor(count($words) / 2); $i < count($words); $i++) { $multi .= $words[$i] . ' '; } $item['description'] = trim($multi); $pdf->SetFillColor(0xff, 0xff, 0xff); $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F'); $pdf->SetXY($left + $width * $column, $y); $pdf->MultiCell($effective_width, 7, $item['description'], 0, 'C'); } break; } } $pdf->SetX($left + $width * $column); $pdf->SetFont('GillBook', '', $this->SMALLER_FONT); $item['size'] = strtolower($item['size']); if (substr($item['size'], -1) != '.') { $item['size'] .= '.'; // end abbreviation w/ period $item['size'] = str_replace('fz.', 'fl oz.', $item['size']); } if (substr($item['size'], 0, 1) == '.') { $item['size'] = '0' . $item['size']; // add leading zero on decimal qty } if (strlen(ltrim($item['upc'], '0')) < 5 && $item['scale']) { $item['size'] = 'PLU# ' . ltrim($item['upc'], '0'); // show PLU #s on by-weight } $pdf->Cell($effective_width, 6, $item['size'], 0, 1, 'C'); $pdf->SetXY($left + $width * $column, $top + $height * $row + ($height - 42)); $pdf->SetFont('Gill', '', $this->BIG_FONT); $pdf->Cell($effective_width, 12, $price, 0, 1, 'C'); if ($item['startDate'] != '' && $item['endDate'] != '') { // intl would be nice $datestr = date('M d', strtotime($item['startDate'])) . chr(0x96) . date('M d', strtotime($item['endDate'])); $pdf->SetXY($left + $width * $column, $top + $height * $row + ($height - 37)); $pdf->SetFont('GillBook', '', $this->SMALLEST_FONT); $pdf->Cell($effective_width, 20, strtoupper($datestr), 0, 1, 'R'); } if ($item['upc'] != '') { $pdf->SetXY($left + $width * $column, $top + $height * $row + ($height - 37)); $pdf->SetFont('GillBook', '', $this->SMALLEST_FONT); $pdf->Cell($effective_width, 20, $item['upc'], 0, 1, 'L'); } $pdf->Image(dirname(__FILE__) . '/' . $this->footer_image, $left - 1 + $width * $column, $top + $height * $row + ($height - $top - 4), $width - 6); $count++; $sign++; } $pdf->Output('Signage12UpL.pdf', 'I'); }
<?php define('FPDF_FONTPATH', '.'); require '../fpdf.php'; $pdf = new FPDF(); $pdf->AddFont('Calligrapher', '', 'calligra.php'); $pdf->AddPage(); $pdf->SetFont('Calligrapher', '', 35); $pdf->Cell(0, 10, 'Enjoy new fonts with FPDF!'); $pdf->Output();
$suplier1=$arr; $w++; $i++; } } } $table2 .= '</table>'.PHP_EOL; $pdf=new FPDF(); $pdf->AddFont('ArialMT','','arial.php'); $pdf->AddFont('Arial-BoldMT','','arialbd.php'); $pdf->AddFont('Arial-BoldItalicMT','','arialbi.php'); $pdf->AddPage(); $pdf->SetFont('Arial-BoldMT','',14); // задаем шрифт и его размер $reportName="НАКЛАДНАЯ /ОБРАЗЦЫ /"; $pdf->Cell( 0, 15, $reportName, 0, 0, 'C' ); $pdf->SetFont('Arial-BoldMT','',8); // задаем шрифт и его размер $pdf->Cell(10,20,'',0,1,'l'); $pdf->ln(0); $pdf->Cell(10,5,'',0,0,'l'); $pdf->SetTextColor(214,3,0); // красный $pdf->Cell(50,5,'Дата составления заявки',1,0,'l'); $pdf->SetTextColor(22,50,255); // синий
<?php define('FPDF_FONTPATH', '../font/'); require '../fpdf.php'; $pdf = new FPDF(); $pdf->AddFont('Calligrapher', '', 'arial_ce.php'); $pdf->AddPage(); $pdf->SetFont('Calligrapher', '', 10); $pdf->MultiCell(0, 10, 'Po¿ar wybuch³ w sk³adzie wojskowym w Uljanowsku, w po³udniowo-wschodniej Rosji. S³ychaæ by³o seriê eksplozji. Nad miastem unosi³ siê s³up czarnego dymu. Teraz, na szczêœcie, sytuacja jest pod kontrol¹. Trwa dogaszanie ognia. W po¿arze zginê³y dwie osoby. Fot. vulyanovske.ru P³on¹ce sk³ady wojskowe w Uljanowsku Fot. vulyanovske.ru P³on¹ce sk³ady wojskowe w Uljanowsku 40-stu zaginionych w po¿arze sk³adów wojskowych odnalaz³o siê ¿ywych. Tak¹ informacjê poda³ gubernator Uljanowska Siergiej Kowaliow. - Jestem niesamowicie szczêœliwy, bo myœleliœmy, ¿e ju¿ nie ¿yj¹, a oni uciekli z po¿ogi - doda³ Kowaliow. Wci¹¿ poszukiwanych jest 11 osób. Do tej pory potwierdzono dwie ofiary wybuchów. To stra¿acy, którzy uczestniczyli w akcji gaœniczej. Po¿ar wybuch³ oko³o 13.50 naszego czasu. W licz¹cym 600 tys. mieszkañców mieœcie nad Wo³g¹ s³ychaæ by³o ogromne eksplozje. Dochodzi³y one z kierunku, gdzie znajduje siê jednostka Marynarki Wojennej Federacji Rosyjskiej. Jednostka po³o¿ona jest w dzielnicy Zawo³¿skiej, mieszka tam 100 tys. ludzi. W bliskim s¹siedztwie jednostki s¹ wysokie domy mieszkalne. Z zagro¿onego rejonu ewakuowano 3 tys. osób. P³on¹ sk³ady wojskowe w Rosji Nie ma zatrucia wody i atmosfery Ministerstwo Obrony Rosji potwierdzi³o fakt po¿aru na terenie jednego ze swoich obiektów. Nie poda³o jednak szczegó³ów. Wed³ug wiadomoœci Interfaksu, po¿ar obj¹³ sk³ad konwencjonalnej broni. Informator agencji poda³, ¿e do wybuchu ognia dosz³o najprawdopodobniej podczas utylizacji starych ³adunków. W Uljanowsku zosta³ powo³any sztab operacyjny, który zajmie siê likwidacj¹ nastêpstw po¿aru. Jego dogaszanie mo¿e potrwaæ nawet do rana. Nadal s³ychaæ sporadyczne wybuchy pocisków. Funkcjonariusze regionalnego Ministerstwa do Spraw Nadzwyczajnych poinformowali, ze wybuchy amunicji nie stworzy³y zagro¿enia zatrucia wody i atmosfery. Internauci: Do zobaczenia w wiadomoœciach Mieszkañcy Uljanowska pisali o fali uderzeniowej wybuchów, która wybija³a okna w blokach. O po¿arze natychmiast zaczêli siê informowaæ internauci na lokalnych stronach. - S³ychaæ wybuchy, ogromny s³up czarnego dymu i p³omieni. To chyba arsena³ p³onie. - Dzwoni³a do mnie dziewczyna. Wybuchy s³ychaæ bez przerwy i czuæ uderzenia fal uderzeniowych. Ogl¹dajcie nas w g³ównych wiadomoœciach - pisa³ na jednej z lokalnych stron internauta o nicku "doktorhouse".
function PrintChecks() { //////////////////////////// // label-specific variables $page_width = 8.5; $page_height = 11; $top_margin = 0; $left_margin = 2.5; $columns = 1; $gutter = 3 / 16; $rows = 3; // only used for making page breaks, no position calculations $label_height = 2.85; $label_width = 6; // cell margins $cell_left = 0.25; $cell_top = 0.25; $cell_bot = 0.25; // //////////////////////////// $img_ratio = 1.4; // loqisaur $img_ratio = 0.47; // cyan $img_ratio = 1.71; // marvelous labs $logo_width = 0.66; // loqisaur $logo_width = 0.2; // cyan $logo_width = 0.5; // marvelous labs $pdf = new FPDF('P', 'in', array($page_width, $page_height)); $pdf->AddFont('Twcen', '', 'twcen.php'); $pdf->AddFont('Micr', '', 'micr.php'); $pdf->AddFont('Courier', '', 'courier.php'); $pdf->SetMargins($left_margin, $top_margin); $pdf->SetDisplayMode("fullpage", "continuous"); $pdf->AddPage(); $lpos = 0; foreach ($this->checks as $check) { $pos = $lpos % ($rows * $columns); // calculate coordinates of top-left corner of current cell // margin cell offset $x = $left_margin + $pos % $columns * ($label_width + $gutter); // margin cell offset $y = $top_margin + floor($pos / $columns) * $label_height; ///////////////// // set up check template $pdf->SetFont('Twcen', '', 11); // print check number $pdf->SetXY($x + 5.25, $y + 0.33); $pdf->Cell(1, 11 / 72, $check['check_number'], 0, 'R'); $logo_offset = 0; // offset to print name if logo is inserted if (array_key_exists('logo', $check) && $check['logo'] != "") { // logo should be: 0.71" x 0.29" $logo_offset = $logo_width + 0.005; // width of logo $pdf->Image($check['logo'], $x + $cell_left, $y + $cell_top + 0.12, $logo_width); } $pdf->SetFont('Twcen', '', 7); // name $pdf->SetXY($x + $cell_left + $logo_offset, $y + $cell_top + 0.1); $pdf->SetFont('Twcen', '', 10); $pdf->Cell(2, 10 / 72, $check['from_name'], 0, 2); $pdf->SetFont('Twcen', '', 7); $pdf->Cell(2, 7 / 72, $check['from_address1'], 0, 2); $pdf->Cell(2, 7 / 72, $check['from_address2'], 0, 2); // date $pdf->Line($x + 3.5, $y + 0.58, $x + 3.5 + 1.2, $y + 0.58); $pdf->SetXY($x + 3.5, $y + 0.48); $date_str = $this->matchcase($check['from_name'], "date"); $pdf->Cell(1, 7 / 72, $date_str); // pay to the order of $pdf->Line($x + $cell_left, $y + 1.1, $x + $cell_left + 4.1, $y + 1.1); $pdf->SetXY($x + $cell_left, $y + 0.88); $pay_str = $this->matchcase($check['from_name'], "pay to the order of"); $pdf->MultiCell(0.6, 7 / 72, $pay_str, '', '', 'L'); // amount box $pdf->Rect($x + 4.5, $y + 0.83, 1.1, 0.25); // dollars $pdf->Line($x + $cell_left, $y + 1.5, $x + $cell_left + 5.37, $y + 1.5); $pdf->SetXY($x + $cell_left + 4.37, $y + 1.4); $dollar_str = $this->matchcase($check['from_name'], "dollars"); $pdf->Cell(1, 7 / 72, $dollar_str, '', '', 'R'); // bank info $pdf->SetXY($x + $cell_left, $y + 1.6); $pdf->Cell(2, 7 / 72, $check['bank_1'], 0, 2); $pdf->Cell(2, 7 / 72, $check['bank_2'], 0, 2); $pdf->Cell(2, 7 / 72, $check['bank_3'], 0, 2); $pdf->Cell(2, 7 / 72, $check['bank_4'], 0, 2); // memo $pdf->Line($x + $cell_left, $y + 2.225, $x + $cell_left + 2.9, $y + 2.225); $pdf->SetXY($x + $cell_left, $y + 2.125); $memo_str = $this->matchcase($check['from_name'], "memo"); $pdf->Cell(1, 7 / 72, $memo_str); // signature line $pdf->Line($x + 3.25, $y + 2.225, $x + 3.25 + 2.375, $y + 2.225); //////////////////////// // fill in values for this check $pdf->SetFont('Courier', '', 11); // date if ($check['date'] != "") { $pdf->SetXY($x + 3.5 + 0.3, $y + 0.38); $pdf->Cell(1, 0.25, $check['date']); } // pay to if ($check['pay_to'] != "") { $pdf->SetXY($x + $cell_left + 0.5, $y + 0.88); $pdf->Cell(1, 0.25, $check['pay_to']); } // amount if ($check['amount'] > 0) { $dollars = intval($check['amount']); $cents = round(($check['amount'] - $dollars) * 100); //$dollars_str = TextualNumber::GetText($dollars); $numtxt = new TextualNumber($dollars); $dollars_str = $numtxt->numToWords($dollars); $amt_string = "***" . ucfirst(strtolower($dollars_str)) . " dollars"; if ($cents > 0) { $amt_string .= " and " . $cents . "/100"; } else { $amt_string .= " and 00/100"; } $amt_string .= "***"; $pdf->SetFont('Courier', '', 9); $pdf->SetXY($x + $cell_left, $y + 1.28); $pdf->Cell(1, 0.25, $amt_string); #$amt = '$'.sprintf("%01.2f",$check['amount']); $amt = '$' . number_format($check['amount'], 2); $pdf->SetXY($x + 4.5 + 0.06, $y + 0.83); $pdf->Cell(1, 0.25, $amt); } // memo $pdf->SetFont('Courier', '', 8); $pdf->SetXY($x + $cell_left + 0.3, $y + 2.02); $pdf->Cell(1, 0.25, $check['memo']); $pdf->SetFont('Courier', '', 11); // routing and account number $pdf->SetFont('Micr', '', 10); $routingstring = "t" . $check['routing_number'] . "t" . $check['account_number'] . "o" . $check['check_number']; if (array_key_exists('codeline', $check)) { $routingstring = $check['codeline']; } $pdf->SetXY($x + $cell_left, $y + 2.47); $pdf->Cell(5, 10 / 72, $routingstring); // signature if (substr($check['signature'], -3) == 'png') { $sig_offset = 1.75; // width of signature $pdf->Image($check['signature'], $x + $cell_left + 3.4, $y + 1.88, $sig_offset); } else { $pdf->SetFont('Arial', 'i', 10); if ($check['signature'] != "") { $pdf->SetXY($x + $cell_left + 3.4, $y + 2.01); $pdf->Cell(1, 0.25, $check['signature']); } } // pre-authorized disclaimer $pdf->SetFont('Arial', '', 6); if (isset($check['pre_auth'])) { $pdf->SetXY($x + $cell_left + 3.3, $y + 2.155); $pdf->Cell(1, 0.25, "This check is pre-authorized by your depositor"); } if ($pos == $rows * $columns - 1 && !($lpos == count($this->checks) - 1)) { $pdf->AddPage(); } $lpos++; } $pdf->Output(); }
public function post_id_upc_terms_handler() { $this->id = preg_split('/[^\\d]/', $this->id, 0, PREG_SPLIT_NO_EMPTY); $pdf = new FPDF('P', 'mm', 'Letter'); $pdf->SetMargins(6.35, 6.35, 6.35); // quarter-inch margins $pdf->SetAutoPageBreak(false); $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php'); $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php'); $margins = $pdf->GetMargins(); $margins['top'] = 0.0; $check_left_x = $margins['left'] > 3.175 ? $margins['right'] : 3.175 - $margins['left']; $real_check_top_y = 183.675 - $margins['top']; $check_right_x = 203.2 - $margins['left']; $real_check_bottom_y = 255.112 - $margins['top']; $line_height = 5; $envelope_window_tab = 15; $right_col1 = 130; $right_col2 = 170; $my_address = array('610 E 4th St', 'Duluth, MN 55805', 'Tel: 218.728.0884', 'www.wholefoods.coop'); $check_date = date('F j, Y'); $dbc = $this->connection; $dbc->setDefaultDB($this->config->get('OP_DB')); $signage = new COREPOS\Fannie\API\item\FannieSignage(array()); foreach ($this->id as $card_no) { $pdf->AddPage(); $account = \COREPOS\Fannie\API\member\MemberREST::get($card_no); $primary = array(); foreach ($account['customers'] as $c) { if ($c['accountHolder']) { $primary = $c; break; } } $check_number = rand(100000, 999995); for ($i = 0; $i < 3; $i++) { $pdf->SetFont('Gill', '', 10); $check_top_y = $real_check_top_y - $i * 90; $check_bottom_y = $real_check_bottom_y - $i * 90; $pdf->SetXY($check_left_x, $check_top_y); $pdf->Ln($line_height * 4.25); foreach ($my_address as $line) { $pdf->SetX($check_left_x + $envelope_window_tab + 20); if ($line == 'www.wholefoods.coop') { $pdf->SetFont('Gill', 'B', 9); } $pdf->Cell(0, $line_height, $line, 0, 1); } $pdf->SetFont('Gill', 'B', 10); $pdf->SetXY($check_left_x + $right_col1, $check_top_y); $pdf->Cell(30, $line_height, 'Check Number:', 0, 0, 'R'); $pdf->SetFont('Gill', '', 10); $pdf->SetTextColor(0xff, 0x58, 0); $pdf->SetX($check_left_x + $right_col2); $pdf->Cell(30, $line_height, $check_number, 0, 0, 'R'); $pdf->SetFont('Gill', 'B', 10); $pdf->SetTextColor(0, 0, 0); $pdf->SetXY($check_left_x + $right_col1, $check_top_y + 1.5 * $line_height); $pdf->Cell(30, $line_height, 'Date:', 0, 0, 'R'); $pdf->SetFont('Gill', '', 10); $pdf->SetTextColor(0xff, 0x58, 0); $pdf->SetX($check_left_x + $right_col2); $pdf->Cell(30, $line_height, $check_date, 0, 0, 'R'); $pdf->SetXY($check_left_x + $right_col1, $check_top_y + 3 * $line_height); $pdf->SetFont('Gill', 'B', 10); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(30, $line_height, 'Amount:', 0, 0, 'R'); $pdf->SetXY($check_left_x + $right_col1 + 30, $check_top_y + 3 * $line_height); $pdf->SetFont('Gill', '', 10); $pdf->SetTextColor(0xff, 0x58, 0); $pdf->MultiCell(40, $line_height, str_repeat(' ', 2) . $this->terms, 0, 'R'); $pdf->SetTextColor(0, 0, 0); $their_address = array($primary['firstName'] . ' ' . $primary['lastName']); $their_address[] = $account['addressFirstLine']; if ($account['addressSecondLine']) { $their_address[] = $account['addressSecondLine']; } $their_address[] = $account['city'] . ', ' . $account['state'] . ' ' . $account['zip']; $pdf->SetXY($check_left_x + $envelope_window_tab, $check_top_y + 11 * $line_height); $pdf->SetFont('Gill', 'B', 10); foreach ($their_address as $line) { $pdf->SetX($check_left_x + $envelope_window_tab); $pdf->Cell(0, $line_height, $line, 0, 1); } $pdf->SetFont('Gill', '', 10); $pdf->SetXY($check_left_x, $check_bottom_y + $line_height - 1); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Gill', 'B', 10); $pdf->Cell(0, $line_height, 'Redeemable only at Whole Foods Co-op', 0, 0, 'C'); $pdf->SetFont('Gill', '', 10); $pdf->SetXY($check_left_x + 145, $check_top_y + 6 * $line_height + 1); $pdf->SetFont('Gill', '', 8); $pdf->MultiCell(50, $line_height - 2, 'Limit one per day. Cannot be applied to previous purchases. No cash value.'); $pdf->SetFont('Gill', '', 10); $pdf->SetFillColor(0xcc, 0xcc, 0xcc); $pdf->Rect($check_left_x + 84, $check_top_y + 28, 39, 15, 'F'); $pdf->SetFillColor(0, 0, 0); $signage->drawBarcode(ltrim($this->upc, '0'), $pdf, $check_left_x + 87, $check_top_y + 30, array('height' => 11, 'fontsize' => 0)); $pdf->Image('logo.rgb.noalpha.png', $check_left_x + $envelope_window_tab, $check_top_y + 20, 20); $pdf->SetFont('Gill', 'B', '31'); $pdf->SetXY($check_left_x + $envelope_window_tab, $check_top_y + 0.5 * $line_height); $pdf->SetTextColor(0xff, 0x58, 0); $pdf->Cell(0, 3 * $line_height, 'We Appreciate You!'); $pdf->SetFont('Gill', '', '10'); $pdf->SetTextColor(0, 0, 0); $pdf->Image(dirname(__FILE__) . '/../GiveUsMoneyPlugin/img/sig.png', $check_right_x - 63.5, $check_top_y + 9 * $line_height, 63.5); $pdf->SetXY($check_right_x - 63.5, $check_top_y + 12 * $line_height); $pdf->Cell(63.5, $line_height, 'Authorized By Signature', 'T'); $check_number++; } } $pdf->Output(); }