當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FPDF::AddFont方法代碼示例

本文整理匯總了PHP中FPDF::AddFont方法的典型用法代碼示例。如果您正苦於以下問題:PHP FPDF::AddFont方法的具體用法?PHP FPDF::AddFont怎麽用?PHP FPDF::AddFont使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FPDF的用法示例。


在下文中一共展示了FPDF::AddFont方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: post_id_upc_terms_handler

 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');
//.........這裏部分代碼省略.........
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:101,代碼來源:CheckCouponMailing.php

示例2: preprocess

 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;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:30,代碼來源:MemberStickerPage.php

示例3: drawPDF

 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');
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:52,代碼來源:WfcProduceSingle.php

示例4: genpdf

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();
}
開發者ID:BGCX067,項目名稱:faaa-multifac-svn-to-git,代碼行數:70,代碼來源:create_relance.php

示例5: drawPDF

 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);
//.........這裏部分代碼省略.........
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:101,代碼來源:CoopDeals16UpDarkP.php

示例6: generatePDF

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');
}
開發者ID:2618094,項目名稱:serial_numbers,代碼行數:35,代碼來源:includes.php

示例7: post_id_handler

 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;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:35,代碼來源:StatementsPluginPostCards.php

示例8: UsersTrafficPeriodPDF

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();
}
開發者ID:ruNovel,項目名稱:sams2,代碼行數:36,代碼來源:usersbuttom_2_traffic.php

示例9: FPDF

<?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');
開發者ID:BackupTheBerlios,項目名稱:aligilo-svn,代碼行數:17,代碼來源:zeichensatz.php

示例10: FPDF

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');
開發者ID:Joshuabenitez,項目名稱:Proyecto-industria,代碼行數:31,代碼來源:reporte_estudiante.php

示例11: text_field

 /**
  * 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
     }
 }
開發者ID:reti-senza-frontiere,項目名稱:WP-Plugins,代碼行數:43,代碼來源:class-wc-voucher.php

示例12: post_id_handler

 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;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:64,代碼來源:StatementsPluginTerm.php

示例13: EPListProvider

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
開發者ID:dhMuse,項目名稱:ep-character-creator,代碼行數:31,代碼來源:pdfExporterV2_fpdf.php

示例14: ZipArchive

         $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');
開發者ID:kapai69,項目名稱:fl-ru-damp,代碼行數:31,代碼來源:get.php

示例15: FPDF

<?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  );
開發者ID:jutturong,項目名稱:esn2_complete_18-1-59,代碼行數:31,代碼來源:report_app1+(copy).php


注:本文中的FPDF::AddFont方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。