当前位置: 首页>>代码示例>>PHP>>正文


PHP TCPDF::SetTitle方法代码示例

本文整理汇总了PHP中TCPDF::SetTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::SetTitle方法的具体用法?PHP TCPDF::SetTitle怎么用?PHP TCPDF::SetTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCPDF的用法示例。


在下文中一共展示了TCPDF::SetTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testPdfOutput

 public function testPdfOutput()
 {
     $this->markTestIncomplete('Transparency rendering on signature not working.');
     // create new PDF document
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('TCPDF Example 052');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 052', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // set some language-dependent strings (optional)
     $pdf->setLanguageArray($this->langSettings);
     // ---------------------------------------------------------
     /*
     NOTES:
      - To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt
      - To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12
      - To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes
     */
     // set certificate file
     $certificate = 'file://tests/data/cert/tcpdf.crt';
     // set additional information
     $info = array('Name' => 'TCPDF', 'Location' => 'Office', 'Reason' => 'Testing TCPDF', 'ContactInfo' => 'http://www.tcpdf.org');
     // set document signature
     $pdf->setSignature($certificate, $certificate, 'tcpdfdemo', '', 2, $info);
     // set font
     $pdf->SetFont('helvetica', '', 12);
     // add a page
     $pdf->AddPage();
     // print a line of text
     $text = 'This is a <b color="#FF0000">digitally signed document</b> using the default (example) <b>tcpdf.crt</b> certificate.<br />To validate this signature you have to load the <b color="#006600">tcpdf.fdf</b> on the Arobat Reader to add the certificate to <i>List of Trusted Identities</i>.<br /><br />For more information check the source code of this example and the source code documentation for the <i>setSignature()</i> method.<br /><br /><a href="http://www.tcpdf.org">www.tcpdf.org</a>';
     $pdf->writeHTML($text, true, 0, true, 0);
     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     // *** set signature appearance ***
     // create content for signature (image and/or text)
     $pdf->Image('tests/images/tcpdf_signature.png', 180, 60, 15, 15, 'PNG');
     // define active area for signature appearance
     $pdf->setSignatureAppearance(180, 60, 15, 15);
     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     // *** set an empty signature appearance ***
     $pdf->addEmptySignatureAppearance(180, 80, 15, 15);
     $this->comparePdfs($pdf);
 }
开发者ID:fooman,项目名称:tcpdf,代码行数:59,代码来源:Example052Test.php

示例2: testPdfOutput

    public function testPdfOutput()
    {
        // create new PDF document
        $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
        // set document information
        $pdf->SetCreator(PDF_CREATOR);
        $pdf->SetAuthor('Nicola Asuni');
        $pdf->SetTitle('TCPDF Example 001');
        $pdf->SetSubject('TCPDF Tutorial');
        $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
        // set default header data
        $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
        $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
        // set header and footer fonts
        $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
        $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
        // set default monospaced font
        $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
        // set margins
        $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
        $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
        $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
        // set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
        // set image scale factor
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
        // set some language-dependent strings (optional)
        $pdf->setLanguageArray($this->langSettings);
        // ---------------------------------------------------------
        // set default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        // dejavusans is a UTF-8 Unicode font, if you only need to
        // print standard ASCII chars, you can use core fonts like
        // helvetica or times to reduce file size.
        $pdf->SetFont('dejavusans', '', 14, '', true);
        // Add a page
        // This method has several options, check the source code documentation for more information.
        $pdf->AddPage();
        // set text shadow effect
        $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
        // Set some content to print
        $html = <<<EOD
<h1>Welcome to <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;">&nbsp;<span style="color:black;">TC</span><span style="color:white;">PDF</span>&nbsp;</a>!</h1>
<i>This is the first example of TCPDF library.</i>
<p>This text is printed using the <i>writeHTMLCell()</i> method but you can also use: <i>Multicell(), writeHTML(), Write(), Cell() and Text()</i>.</p>
<p>Please check the source code documentation and other examples for further information.</p>
<p style="color:#CC0000;">TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE <a href="http://sourceforge.net/donate/index.php?group_id=128076">MAKE A DONATION!</a></p>
EOD;
        // Print text using writeHTMLCell()
        $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
        $this->comparePdfs($pdf);
    }
开发者ID:fooman,项目名称:tcpdf,代码行数:53,代码来源:Example001Test.php

示例3: testPdfOutput

 public function testPdfOutput()
 {
     // create new PDF document
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('TCPDF Example 017');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 017', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // set some language-dependent strings (optional)
     $pdf->setLanguageArray($this->langSettings);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', '', 20);
     // add a page
     $pdf->AddPage();
     $pdf->Write(0, 'Example of independent Multicell() columns', '', 0, 'L', true, 0, false, false, 0);
     $pdf->Ln(5);
     $pdf->SetFont('times', '', 12);
     // create columns content
     // create columns content
     $left_column = '[LEFT COLUMN] left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column' . "\n";
     $right_column = '[RIGHT COLUMN] right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column' . "\n";
     // MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)
     // set color for background
     $pdf->SetFillColor(255, 255, 200);
     // set color for text
     $pdf->SetTextColor(0, 63, 127);
     // write the first column
     $pdf->MultiCell(80, 0, $left_column, 1, 'J', 1, 0, '', '', true, 0, false, true, 0);
     // set color for background
     $pdf->SetFillColor(215, 235, 255);
     // set color for text
     $pdf->SetTextColor(127, 31, 0);
     // write the second column
     $pdf->MultiCell(80, 0, $right_column, 1, 'J', 1, 1, '', '', true, 0, false, true, 0);
     // reset pointer to the last page
     $pdf->lastPage();
     $this->comparePdfs($pdf);
 }
开发者ID:fooman,项目名称:tcpdf,代码行数:56,代码来源:Example017Test.php

示例4: __construct

 /**
  * @param Layout $default_layout
  */
 public function __construct(Layout $default_layout)
 {
     $this->pdf = new \TCPDF('P', 'pt', 'A4', true, 'UTF-8');
     $this->pdf->SetTitle($default_layout->getReportTitle());
     $this->pdf->SetCreator('Thinreports Generator');
     $this->pdf->SetAutoPageBreak(false);
     $this->pdf->SetMargins(0, 0, 0, true);
     $this->pdf->SetCellPadding(0);
     $this->pdf->SetCellMargins(0, 0, 0, 0);
     $this->pdf->SetPrintHeader(false);
     $this->pdf->SetPrintFooter(false);
     $this->default_layout = $default_layout;
     $this->default_page_format = $this->buildPageFormat($default_layout);
 }
开发者ID:k-yamamura,项目名称:thinreports-php,代码行数:17,代码来源:Document.php

示例5: printTicket

 static function printTicket($ticket_html, $order)
 {
     ob_end_clean();
     $config = JComponentHelper::getParams('com_bookpro');
     $page_ticket = "<h1 color='Red'> Wellcome to tcpdf </h1>";
     $page_ticket = $ticket_html;
     // create new PDF document
     $pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
     $order_number = $order->order_number;
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Joombooking');
     $pdf->SetTitle('Travel Ticket ' . $order_number);
     $pdf->SetSubject('Travel Ticket');
     $pdf->SetKeywords('TCPDF, PDF, ticket, travel, booking');
     // set default header data
     //$pdf->SetHeaderData($config->get('company_logo'),50, $config->get('company_name'), "Ticket \n www.");
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     //$pdf->setHeaderMargin(10);
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     //set margins
     //$pdf->SetMargins(30, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     //$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     //set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     //set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     //set some language-dependent strings
     $pdf->setLanguageArray($l);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('times', '', 11);
     // add a page
     $pdf->AddPage();
     // set JPEG quality
     $pdf->setJPEGQuality(75);
     $style['position'] = 'R';
     /*
      *     $type type of barcode (see tcpdf_barcodes_1d.php for supported formats).
      *      
      */
     //$pdf->write1DBarcode($order_number, 'C128B','', '', '', 10, 0.4, $style, 'M');
     // create some HTML content
     //$pdf->writeHTML($htmlcontent, true, 0, true, 0);
     //$pdf->WriteHTML(file_get_contents('test.html'));
     $pdf->WriteHTML($page_ticket);
     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     // reset pointer to the last page
     $pdf->lastPage();
     // ---------------------------------------------------------
     //Close and output PDF document
     ob_end_clean();
     $pdf->Output($order->name . '.pdf', 'I');
     //Should use variable to make file name
     ob_end_flush();
 }
开发者ID:hixbotay,项目名称:executivetransport,代码行数:60,代码来源:pdf.php

示例6: generatePDF

 /**
  * Method creates a PDF in landscape mode, using ilPDFGeneration Job
  * Rest of method similar to superclass method
  *
  * @param ilPDFGenerationJob $job
  */
 public static function generatePDF(ilPDFGenerationJob $job)
 {
     // create new PDF document
     // 'L' for Landscape
     $pdf = new TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator($job->getCreator());
     $pdf->SetAuthor($job->getAuthor());
     $pdf->SetTitle($job->getTitle());
     $pdf->SetSubject($job->getSubject());
     $pdf->SetKeywords($job->getKeywords());
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     $pdf->SetMargins($job->getMarginLeft(), $job->getMarginTop(), $job->getMarginRight());
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     $pdf->SetAutoPageBreak($job->getAutoPageBreak(), $job->getMarginBottom());
     $pdf->setImageScale($job->getImageScale());
     $pdf->SetFont('dejavusans', '', 10);
     foreach ($job->getPages() as $page) {
         $pdf->AddPage();
         $pdf->writeHTML($page, true, false, true, false, '');
     }
     $result = $pdf->Output($job->getFilename(), $job->getOutputMode());
     // (I - Inline, D - Download, F - File)
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:33,代码来源:class.ilRoomSharingTCPDFGenerator.php

示例7: initTcpdfObject

 private function initTcpdfObject()
 {
     $tcpdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     if ($this->creator) {
         $tcpdf->SetCreator($this->creator);
     }
     if ($this->author) {
         $tcpdf->SetAuthor($this->author);
     }
     if ($this->title) {
         $tcpdf->SetTitle($this->title);
     }
     if ($this->subject) {
         $tcpdf->SetSubject($this->subject);
     }
     if (!empty($this->keywords)) {
         $tcpdf->SetKeywords(implode(', ', $this->keywords));
     }
     // set default header data
     //$tcpdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING);
     // document defaults
     $tcpdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $tcpdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $tcpdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     $tcpdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);
     $tcpdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     return $tcpdf;
 }
开发者ID:martinlindhe,项目名称:core3,代码行数:28,代码来源:Pdf.php

示例8: run

 public function run()
 {
     include getcwd() . '/vendor/autoload.php';
     $navStructure = (include getcwd() . '/docs/navigation.php');
     echo "Loading markdown...\n";
     $markdown = $this->findMarkdown($navStructure);
     echo "Converting markdown to html...\n";
     $Parsedown = new \Parsedown();
     $html = $Parsedown->text($markdown);
     $pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     $pdf->SetCreator(PDF_CREATOR);
     #$pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('My Documentation');
     #$pdf->SetSubject('TCPDF Tutorial');
     #$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     $pdf->SetFont('helvetica', '', 20);
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->AddPage();
     $pdf->writeHTML($html, true, 0, true, 0);
     $pdf->lastPage();
     echo "Writing PDF...\n";
     $pdf->Output($this->config['output'], 'F');
     echo "Complete.\n";
 }
开发者ID:dev-lucid,项目名称:lucid,代码行数:27,代码来源:BuildDocs.php

示例9: switch

 /**
  * Add meta information to the PDF
  *
  * TCPDF does not have a generic method to do this, but limits the possible info to add
  * to well specific cases
  *
  * @param string $label  label of the value (Creator, Producter, etc.)
  * @param string $value  the text to set
  */
 function add_info($label, $value)
 {
     dompdf_debug("trace", "({$label}, {$value})");
     global $_dompdf_warnings;
     switch ($label) {
         case 'Creator':
             $this->_pdf->SetCreator($value);
             break;
         case 'Author':
             $this->_pdf->SetAuthor($value);
             break;
         case 'Title':
             $this->_pdf->SetTitle($value);
             break;
         case 'Subject':
             $this->_pdf->SetSubject($value);
             break;
         case 'Keywords':
             $this->_pdf->SetKeywords($value);
             break;
         default:
             $_dompdf_warnings[] = "add_info: label '{$label}' is not supported by the TCPDF library.";
             break;
     }
 }
开发者ID:Razinsky,项目名称:echaude-com,代码行数:34,代码来源:tcpdf_adapter.cls.php

示例10: __construct

 /**
  * 初始化
  *
  * @access public
  * @param  array  $params 初始化参数
  * @return void
  */
 public function __construct($params)
 {
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor($this->pdf_author);
     $pdf->SetTitle($this->pdf_title);
     $pdf->SetSubject($this->pdf_subject);
     $pdf->SetKeywords($this->pdf_keywords);
     // 不显示头部和底部
     $pdf->setPrintHeader(FALSE);
     $pdf->setPrintFooter(FALSE);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     //set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     //set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     //set some language-dependent strings
     require TCPDF_BASE_PATH . 'tcpdf/config/lang/eng.php';
     $pdf->setLanguageArray($l);
     // set font
     $pdf->SetFont('stsongstdlight', '', 10);
     $pdf->AddPage();
     $pdf->writeHTML($params['content'], true, false, true, false, '');
     $pdf->lastPage();
     // 输出方式 I:浏览器直接输出 D:文件下载 如果需要浏览器输出或者下载的同时生成文件请在前面加上F
     $pdf->Output($params['filename'], $params['flag']);
 }
开发者ID:tmlsoft,项目名称:main,代码行数:35,代码来源:pdf.php

示例11: create_pdf

function create_pdf($content, $title)
{
    tcpdf();
    $obj_pdf = new TCPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $obj_pdf->SetCreator(PDF_CREATOR);
    $title = $title;
    $obj_pdf->SetTitle('MultiTV analytics');
    $obj_pdf->SetAuthor('MultiTv');
    $obj_pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, $title, PDF_HEADER_STRING);
    $obj_pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    $obj_pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
    $obj_pdf->SetDefaultMonospacedFont('helvetica');
    $obj_pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $obj_pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $obj_pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $obj_pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    $obj_pdf->SetFont('helvetica', '', 9);
    $obj_pdf->setFontSubsetting(false);
    $obj_pdf->AddPage();
    //ob_start();
    // we can have any view part here like HTML, PHP etc
    //$content = ob_get_contents();
    ob_end_clean();
    $obj_pdf->writeHTML($content, true, false, true, false, '');
    $obj_pdf->Output('output.pdf', 'I');
}
开发者ID:anandcyberlinks,项目名称:cyberlinks-demo,代码行数:26,代码来源:pdf_helper.php

示例12: initPDF

 private function initPDF()
 {
     parent::SetCreator(PDF_CREATOR);
     parent::SetAuthor($this->author);
     parent::SetTitle($this->title);
     parent::SetSubject($this->subject);
 }
开发者ID:youssefbenhssaien,项目名称:MVC-PHP,代码行数:7,代码来源:html2pdf.class.php

示例13: generateTicket

 /**
  * Generates the
  *
  * @param   string  $booking      - The booking
  * @param   string  $text         - The text
  * @param   string  $subject      - The subject
  * @param   string  $destination  - Where should the generated file been send
  *
  * @return  string
  */
 public static function generateTicket($booking, $text, $subject, $destination = "D")
 {
     $fn = "ticket-" . MatukioHelperUtilsBooking::getBookingId($booking->id) . ".pdf";
     // Check if PDF was already created
     if (JFile::exists($fn)) {
         return $fn;
     }
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Matukio by compojoom.com');
     $pdf->SetTitle($subject);
     $pdf->SetSubject($subject);
     $pdf->SetKeywords('Ticket, Matukio, compojoom');
     // remove default header/footer
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // add a page
     $pdf->AddPage();
     $pdf->writeHTML($text, true, false, true, false, '');
     // Close and output PDF document
     // This method has several options, check the source code documentation for more information.
     return $pdf->Output($fn, $destination);
 }
开发者ID:JonatanLiecheski,项目名称:MeditecJoomla,代码行数:40,代码来源:pdf.php

示例14: initPdf

 /**
  * initPdf - initialize TCPDF with current setting
  *
  * @return void
  */
 private function initPdf()
 {
     if (empty($this->pdfEngine)) {
         $this->pdfEngine = new TCPDF($this->pageOrientation, $this->unit, $this->pageSize, true, 'UTF-8', false);
         if (isset($this->pdfAuthor)) {
             $this->pdfEngine->SetAuthor($this->pdfAuthor);
         }
         if (isset($this->pdfTitle)) {
             $this->pdfEngine->SetTitle($this->pdfTitle);
         }
         if (isset($this->pdfSubject)) {
             $this->pdfEngine->SetSubject($this->pdfSubject);
         }
         if (isset($this->pdfKeywords)) {
             $keywords = is_array($this->pdfKeywords) ? implode(', ', $this->pdfKeywords) : (string) $this->pdfKeywords;
             $this->pdfEngine->SetKeywords($keywords);
         }
         if (!empty($this->pdfCreator)) {
             $this->pdfEngine->SetCreator($this->pdfCreator);
         }
         if (!empty($this->fontFamily)) {
             $this->pdfEngine->SetFont($this->fontFamily, $this->fontStyle, $this->fontSize);
         }
         if (!empty($this->monoFontFamily)) {
             $this->pdfEngine->SetDefaultMonospacedFont($this->monoFontFamily);
         }
         if (!empty($this->leftMargin)) {
             $this->pdfEngine->SetMargins($this->leftMargin, $this->topMargin, $this->rightMargin);
         }
         if (empty($this->bottomMargin)) {
             $this->bottomMargin = PDF_MARGIN_BOTTOM;
         }
         $this->pdfEngine->SetAutoPageBreak(true, $this->bottomMargin);
     }
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:40,代码来源:HtmlToPdfProvider.php

示例15: __construct

 /**
  * @param Layout|null $default_layout
  */
 public function __construct(Layout $default_layout = null)
 {
     $this->pdf = new \TCPDF('P', 'pt', 'A4', true, 'UTF-8');
     $this->pdf->SetCreator('Thinreports Generator');
     $this->pdf->SetAutoPageBreak(false);
     $this->pdf->SetMargins(0, 0, 0, true);
     $this->pdf->SetCellPadding(0);
     $this->pdf->SetCellMargins(0, 0, 0, 0);
     $this->pdf->SetPrintHeader(false);
     $this->pdf->SetPrintFooter(false);
     if ($default_layout !== null) {
         $this->pdf->SetTitle($default_layout->getReportTitle());
         $this->registerPageFormat($default_layout);
     }
     $this->initDrawer();
 }
开发者ID:monnouchi,项目名称:thinreports-php,代码行数:19,代码来源:Document.php


注:本文中的TCPDF::SetTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。