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


PHP FPDF類代碼示例

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


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

示例1: out

 /**
  * Outputs the PDF indirect object to PDF file.
  * 
  * To pervent infinite loop on circular references, this method checks 
  * if current object have been already written to the file.
  *
  * Note that, in general, nested objects should be written to PDF file
  * here too; this task is accomplished by calling _out_nested method,
  * which should be overridden by children classes.
  *
  * @param FPDF $handler PDF file wrapper (FPDF object)
  * 
  * @final
  *
  * @see FPDF::is_object_written
  * @see PDFIndirectObject::_out_nested
  */
 function out(&$handler)
 {
     if (!$handler->is_object_written($this->get_object_id())) {
         $handler->offsets[$this->get_object_id()] = strlen($handler->buffer);
         $handler->_out($handler->_indirect_object($this));
         $this->_out_nested($handler);
     }
 }
開發者ID:raimundlandig,項目名稱:winkel.de-DEV,代碼行數:25,代碼來源:fpdf.php

示例2: geraEtiquetasPDF

 function geraEtiquetasPDF($qrcode, $qnt, $nome)
 {
     $pdf = new FPDF("P", "pt", "A4");
     $pdf->AddPage();
     $posY = 3;
     $posX = 5;
     $controle = 0;
     $qntElementos = 1;
     for ($k = 1; $k <= 80; $k += 4) {
         // linha
         for ($j = 1; $j <= 5; $j++) {
             // coluna
             $pdf->Image("../etiquetas/{$qrcode[$controle]}.png", $posX, $posY, 114, 38);
             $controle++;
             $posX += 119;
             if ($qntElementos == $qnt) {
                 $k = 80;
                 $j = 5;
             }
             $qntElementos++;
         }
         if ($posY < 748) {
             $posY += 45;
         }
         $posX = 3;
     }
     $pdf->Output("../relatorios/etiquetas/{$nome}.pdf", "F");
 }
開發者ID:RTPorfirio,項目名稱:SCJ,代碼行數:28,代碼來源:relatorioEtiquetas.php

示例3: CetakLaporan

function CetakLaporan($prevtahun, $tahun, $gel)
{
    include_once "../fpdf.php";
    $lbr = 190;
    $pdf = new FPDF('P', 'mm', 'A4');
    $pdf->SetTitle("Ratio Presenter PMB - {$prevtahun}/{$tahun}");
    $pdf->AddPage('P');
    $arrStatusAplikan = array();
    $s = "select * from statusaplikan where KodeID='" . KodeID . "' order by Urutan ASC";
    $r = _query($s);
    while ($w = _fetch_array($r)) {
        $arrStatusAplikan[] = $w['StatusAplikanID'];
    }
    // Buat Table 1
    BuatHeaderLap($prevtahun, $tahun, 0, $pdf);
    $arrPresenterID = array();
    GetArrayPresenterSortByRatio($arrPresenterID, $tahun);
    TampilkanIsinya($prevtahun, $tahun, $arrStatusAplikan, $arrPresenterID, 0, $pdf);
    $pdf->Ln(10);
    BuatHeaderLap($prevtahun, $tahun, 1, $pdf);
    $arrPresenterID = array();
    GetArrayPresenterSortByReg($arrPresenterID, $tahun);
    $arrStat = TampilkanIsinya($prevtahun, $tahun, $arrStatusAplikan, $arrPresenterID, 1, $pdf);
    $pdf->Ln(10);
    TampilkanStatistik($arrStat, $tahun, $pdf);
    $pdf->Output();
}
開發者ID:anggadjava,項目名稱:mitra_siakad,代碼行數:27,代碼來源:pmblap.ratiopresenter.php

示例4: CetakLaporan

function CetakLaporan($prevtahun, $tahun, $nexttahun, $urutan, $gel)
{
    include_once "../fpdf.php";
    require_once "../phplot.php";
    $lbr = 190;
    $arrStatusAplikan = array();
    $s = "select * from statusaplikan where KodeID='" . KodeID . "' order by Urutan ASC";
    $r = _query($s);
    while ($w = _fetch_array($r)) {
        $arrStatusAplikan[] = $w['StatusAplikanID'];
    }
    $arrGelombang = array();
    getArrayGelombang($arrGelombang, $tahun);
    // Buat Graph dan dimasukkan ke file dulu
    $piepath = '../tmp/data_fakta_pmb_pie_graph.png';
    $barpath = '../tmp/data_fakta_pmb_bar_graph.png';
    BuatPieGraph($piepath, $prevtahun, $tahun, $urutan, $gel);
    BuatBarGraph($barpath, $prevtahun, $tahun, $arrStatusAplikan, $urutan, $gel);
    // *** Cetak ***
    $pdf = new FPDF('L', 'mm', 'A4');
    $pdf->SetAutoPageBreak(true, 5);
    $pdf->SetTitle("DATA & FAKTA PMB TAHUN AJARAN {$tahun}/{$nexttahun} GELOMBANG " . UbahKeRomawiLimit99($urutan));
    $pdf->AddPage('L');
    BuatHeaderLap($prevtahun, $tahun, $pdf);
    TampilkanIsinya($prevtahun, $tahun, $arrStatusAplikan, $arrGelombang, $pdf);
    TampilkanGraph($piepath, 30, 75, 96, 64, $pdf);
    TampilkanGraph($barpath, 185, 75, 96, 64, $pdf);
    TampilkanSumberInformasi(60, 145, $prevtahun, $tahun, $urutan, $gel, $pdf);
    TampilkanRatioPresenter(185, 145, $arrStatusAplikan, $tahun, $urutan, $gel, $pdf);
    $pdf->Output();
}
開發者ID:anggadjava,項目名稱:sisfor,代碼行數:31,代碼來源:pmblap.faktapmb.php

示例5: __construct

 public function __construct()
 {
     require_once APPPATH . 'third_party/fpdf/fpdf-1.7.php';
     $pdf = new FPDF();
     $pdf->AddPage('P', 'A4');
     $CI =& get_instance();
     $CI->fpdf = $pdf;
 }
開發者ID:kpeet,項目名稱:Brotec_system_repo,代碼行數:8,代碼來源:fpdf_informe_turno.php

示例6: actionHelloWorld

 public function actionHelloWorld()
 {
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 16);
     $pdf->Cell(40, 10, 'Hello World!');
     $pdf->Output();
 }
開發者ID:kit9,項目名稱:ERP_Accounting_Indonesia,代碼行數:8,代碼來源:SReportController.php

示例7: __construct

 public function __construct()
 {
     require_once APPPATH . 'fpdf\\fpdf.php';
     $pdf = new FPDF();
     $pdf->AddPage();
     $CI =& get_instance();
     $CI->fpdf = $pdf;
 }
開發者ID:emonoel10,項目名稱:System,代碼行數:8,代碼來源:fpdf_gen.php

示例8: drawPDF

 public function drawPDF()
 {
     $pdf = new \FPDF('L', 'mm', 'Letter');
     $pdf->SetMargins(3.175, 3.175, 3.175);
     $pdf->SetAutoPageBreak(false);
     $pdf = $this->loadPluginFonts($pdf);
     $pdf->SetFont($this->font, '', 16);
     $data = $this->loadItems();
     $count = 0;
     $sign = 0;
     $width = 136.52;
     $height = 108;
     $top = 30;
     $left = 15;
     $effective_width = $width - 2 * $left;
     foreach ($data as $item) {
         if ($count % 4 == 0) {
             $pdf->AddPage();
             $sign = 0;
         }
         $row = floor($sign / 2);
         $column = $sign % 2;
         $price = $this->printablePrice($item);
         $pdf->SetXY($left + $width * $column, $top + $row * $height);
         $pdf->SetFont($this->font, 'B', $this->SMALL_FONT);
         $pdf->Cell($effective_width, 10, $item['brand'], 0, 1, 'C');
         $pdf->SetX($left + $width * $column);
         $pdf->SetFont($this->font, '', $this->MED_FONT);
         $item['description'] = str_replace("\r", '', $item['description']);
         $pdf->Cell($effective_width, 10, str_replace("\n", '', $item['description']), 0, 1, 'C');
         $pdf->SetX($left + $width * $column);
         $pdf->SetFont($this->alt_font, '', $this->SMALLER_FONT);
         $item['size'] = $this->formatSize($item['size'], $item);
         $pdf->Cell($effective_width, 6, $item['size'], 0, 1, 'C');
         $pdf->SetXY($left + $width * $column, $top + $row * $height + 35);
         $pdf->SetFont($this->font, '', $this->BIG_FONT);
         $pdf->Cell($effective_width, 20, $price, 0, 1, 'C');
         if ($item['startDate'] != '' && $item['endDate'] != '') {
             // intl would be nice
             $datestr = $this->getDateString($item['startDate'], $item['endDate']);
             $pdf->SetXY($left + $width * $column, $top + $height * $row + ($height - $top - 20));
             $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
             $pdf->Cell($effective_width, 20, $datestr, 0, 1, 'R');
         }
         if ($item['originShortName'] != '' || isset($item['nonSalePrice'])) {
             $pdf->SetXY($left + $width * $column, $top + $height * $row + ($height - $top - 20));
             $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
             $text = $item['originShortName'] != '' ? $item['originShortName'] : sprintf('Regular Price: $%.2f', $item['nonSalePrice']);
             $pdf->Cell($effective_width, 20, $text, 0, 1, 'L');
         }
         $count++;
         $sign++;
     }
     $pdf->Output('Signage4UpL.pdf', 'I');
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:55,代碼來源:Signage4UpL.php

示例9: makePdfFile

 public static function makePdfFile($filename, $content)
 {
     if (PdfUtils::$imported == FALSE) {
         require_once 'libs/fpdf/fpdf.php';
     }
     PdfUtils::$imported = true;
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 16);
     //$pdf->Cell(40,10,'Hello World!');
     $pdf->Write(5, $content);
     $pdf->Output($filename, 'F');
 }
開發者ID:alex2stf,項目名稱:phpquick,代碼行數:13,代碼來源:PdfUtils.php

示例10: execute

 public function execute()
 {
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont("helvetica", "B", 16);
     $pdf->Cell(0, 10, "Hello world!", 0, 1);
     $pdf->Ln();
     $pdf->SetFont("helvetica", "", 12);
     $pdf->SetFillColor(192, 192, 192);
     $pdf->Cell(40, 10, "Back", 1, 0, "C", 1);
     $pdf->Link(10, 30, 40, 10, "/demos");
     $pdf->Output();
     $this->output->disable();
 }
開發者ID:shannara,項目名稱:banshee,代碼行數:14,代碼來源:pdf.php

示例11: CetakLaporan

function CetakLaporan($prevtahun, $tahun, $gel)
{
    include_once "../fpdf.php";
    $lbr = 190;
    $pdf = new FPDF('L', 'mm', 'A4');
    $pdf->SetTitle("Ratio Presenter PMB - {$prevtahun}/{$tahun}");
    $pdf->AddPage('L');
    $arrGelombang = array();
    getArrayGelombang($arrGelombang, $tahun);
    $arrPejabatID = array();
    GetArrayPejabat($arrPejabatID, $tahun);
    // Buat Table 1
    BuatHeaderLap($prevtahun, $tahun, $pdf);
    TampilkanIsinya($prevtahun, $tahun, $arrGelombang, $arrPejabatID, $pdf);
    $pdf->Output();
}
開發者ID:anggadjava,項目名稱:mitra_siakad,代碼行數:16,代碼來源:pmblap.rekappanitia.php

示例12: __construct

 /**
  * Constructor of the Class
  *
  * @author Jonathan Sandoval <jonathan_s_pisis@yahoo.com.mx>
  * @param  integer $idUser    idUser
  * @param  integer $idChurch  idChurch
  * @param  boolean $full      full document
  */
 function __construct($idUser = 0, $idChurch = 0)
 {
     //Define the constructor
     parent::FPDF('L', 'mm', 'Letter');
     $this->church = ChurchManager::getSingleChurch('id', $idChurch);
     $this->user = SessionManager::getSingleUser('id', $idUser);
 }
開發者ID:jonatalamantes,項目名稱:NotariusAdOmnes,代碼行數:15,代碼來源:EnvelopeChurch.php

示例13: array

 function __construct($data = array(), $data2 = array(), $options = array())
 {
     parent::__construct();
     $this->data = $data;
     $this->data2 = $data2;
     $this->options = $options;
 }
開發者ID:lillongcillong,項目名稱:TA-LabMS-LSKK-STEI-ITB,代碼行數:7,代碼來源:generate_pdf.php

示例14:

 function __construct()
 {
     parent::__construct('P', 'pt', 'A4');
     $this->setAuthor('Galaxy Swiss');
     $this->addPage();
     $this->nl = false;
 }
開發者ID:SmashingQuasar,項目名稱:galaxy-swiss,代碼行數:7,代碼來源:class.reportpdf.inc.php

示例15: __construct

 public function __construct($id_pessoa, $mes, $ano)
 {
     $this->id_pessoa = $id_pessoa;
     $this->mes = $mes;
     $this->ano = $ano;
     parent::__construct();
 }
開發者ID:landim32,項目名稱:escola-bem-me-quer,代碼行數:7,代碼來源:movimento-pdf.inc.php


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