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


PHP pdf::SetCreator方法代碼示例

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


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

示例1: pdf

// to be configurable
if (!$fontfamily) {
    $fontfamily = PDF_FONT_NAME_MAIN;
}
/**
 * Extend the standard PDF class to get access to some protected values we want to display
 * at the test page.
 *
 * @copyright 2009 David Mudrak <david.mudrak@gmail.com>
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
if ($getpdf) {
    $doc = new pdf();
    $doc->SetTitle('Moodle PDF library test');
    $doc->SetAuthor('Moodle ' . $CFG->release);
    $doc->SetCreator('lib/tests/other/pdflibtestpage.php');
    $doc->SetKeywords('Moodle, PDF');
    $doc->SetSubject('This has been generated by Moodle as its PDF library test page');
    $doc->SetMargins(15, 30);
    $doc->setPrintHeader(true);
    $doc->setHeaderMargin(10);
    $doc->setHeaderFont(array($fontfamily, 'b', 10));
    $doc->setHeaderData('pix/moodlelogo-med-white.gif', 40, $SITE->fullname, $CFG->wwwroot);
    $doc->setPrintFooter(true);
    $doc->setFooterMargin(10);
    $doc->setFooterFont(array($fontfamily, '', 8));
    $doc->AddPage();
    $doc->SetTextColor(255, 255, 255);
    $doc->SetFillColor(255, 203, 68);
    $doc->SetFont($fontfamily, 'B', 24);
    $doc->Cell(0, 0, 'Moodle PDF library test', 0, 1, 'C', 1);
開發者ID:EmmanuelYupit,項目名稱:educursos,代碼行數:31,代碼來源:pdflibtestpage.php

示例2: generate_statistics


//.........這裏部分代碼省略.........
                 }
                 //$myField = "{$surveyid}X{$flt[1]}X{$flt[0]}{$row[0]}[]";
             }
             if ($q2show == 'all') {
                 $summary[] = $myField;
             }
             //$allfields[]=$myField;
         }
     } else {
         // This gets all the 'to be shown questions' from the POST and puts these into an array
         if (!is_array($q2show)) {
             $summary = returnGlobal('summary');
         } else {
             $summary = $q2show;
         }
         //print_r($_POST);
         //if $summary isn't an array we create one
         if (isset($summary) && !is_array($summary)) {
             $summary = explode("+", $summary);
         }
     }
     /**
      * pdf Config
      */
     if ($outputType == 'pdf') {
         //require_once('classes/tcpdf/mypdf.php');
         Yii::import('application.libraries.admin.pdf', true);
         Yii::import('application.helpers.pdfHelper');
         $aPdfLanguageSettings = pdfHelper::getPdfLanguageSettings($language);
         // create new PDF document
         $this->pdf = new pdf();
         $surveyInfo = getSurveyInfo($surveyid, $language);
         // set document information
         $this->pdf->SetCreator(PDF_CREATOR);
         $this->pdf->SetAuthor('LimeSurvey');
         $this->pdf->SetTitle(sprintf(gT("Statistics survey %s"), $surveyid));
         $this->pdf->SetSubject($surveyInfo['surveyls_title']);
         $this->pdf->SetKeywords('LimeSurvey,' . gT("Statistics") . ', ' . sprintf(gT("Survey %s"), $surveyid));
         $this->pdf->SetDisplayMode('fullpage', 'two');
         $this->pdf->setLanguageArray($aPdfLanguageSettings['lg']);
         // set header and footer fonts
         $this->pdf->setHeaderFont(array($aPdfLanguageSettings['pdffont'], '', PDF_FONT_SIZE_MAIN));
         $this->pdf->setFooterFont(array($aPdfLanguageSettings['pdffont'], '', PDF_FONT_SIZE_DATA));
         // set default header data
         // Since png crashes some servers (and we can not try/catch that) we use .gif (or .jpg) instead
         $headerlogo = 'statistics.gif';
         $this->pdf->SetHeaderData($headerlogo, 10, gT("Quick statistics", 'unescaped'), gT("Survey") . " " . $surveyid . " '" . flattenText($surveyInfo['surveyls_title'], false, true, 'UTF-8') . "'");
         $this->pdf->SetFont($aPdfLanguageSettings['pdffont'], '', $aPdfLanguageSettings['pdffontsize']);
         // set default monospaced font
         $this->pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     }
     if ($outputType == 'xls') {
         /**
          * Initiate the Spreadsheet_Excel_Writer
          */
         require_once APPPATH . '/third_party/pear/Spreadsheet/Excel/Xlswriter.php';
         if ($pdfOutput == 'F') {
             $sFileName = $sTempDir . '/statistic-survey' . $surveyid . '.xls';
             $this->workbook = new Xlswriter($sFileName);
         } else {
             $this->workbook = new Xlswriter();
         }
         $this->workbook->setVersion(8);
         // Inform the module that our data will arrive as UTF-8.
         // Set the temporary directory to avoid PHP error messages due to open_basedir restrictions and calls to tempnam("", ...)
         $this->workbook->setTempDir($sTempDir);
開發者ID:krsandesh,項目名稱:LimeSurvey,代碼行數:67,代碼來源:statistics_helper.php

示例3: pdf

<?php

require_once 'config.php';
define('ID_LANG', 1);
if (isset($_GET['id'])) {
    $booking = Booking::byId($_GET['id']);
    $user = User::byId($booking->id_user);
    $room = Room::byId($booking->id_room);
    // HEADER
    // create a PDF object
    $pdf = new pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    // set document (meta) information
    $pdf->SetCreator(PDF_CREATOR);
    $pdf->SetAuthor('Hotel Plaza Nueva');
    $pdf->SetTitle('Hotel Plaza Nueva');
    $pdf->SetSubject('Hotel Plaza Nueva');
    $pdf->SetKeywords('hotel, plaza, nueva, granada');
    // add a page
    $pdf->AddPage();
    // create address box
    $pdf->CreateTextBox($user->name, 0, 55, 80, 10, 10, 'B');
    $pdf->CreateTextBox($user->email, 0, 60, 80, 10, 10);
    $pdf->CreateTextBox($user->phone, 0, 65, 80, 10, 10);
    //$pdf->CreateTextBox('Zip, city name', 0, 70, 80, 10, 10);
    // invoice title / number
    $pdf->CreateTextBox('Factura #' . $booking->id, 0, 90, 120, 20, 16);
    // date, order ref
    $date = date_create($booking->date_booking);
    $pdf->CreateTextBox('Fecha: ' . date_format($date, "d/m/Y H:i:s"), 0, 100, 0, 10, 10, '', 'R');
    $pdf->CreateTextBox('Order ref.: #' . $booking->id, 0, 105, 0, 10, 10, '', 'R');
    // ROWS
開發者ID:erseco,項目名稱:ugr_sistemas_de_informacion_basados_en_web,代碼行數:31,代碼來源:pdf.php


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