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


PHP MYPDF::Write方法代码示例

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


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

示例1: dirname

$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)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 20);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of text layout using Multicell()', '', 0, 'L', true, 0, false, false, 0);
$pdf->Ln(5);
$pdf->SetFont('times', '', 9);
//$pdf->SetCellPadding(0);
//$pdf->SetLineWidth(2);
// set color for background
$pdf->SetFillColor(255, 255, 200);
$text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.

Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.';
// print some rows just as example
for ($i = 0; $i < 10; ++$i) {
    $pdf->MultiRow('Row ' . ($i + 1), $text . "\n");
}
// reset pointer to the last page
$pdf->lastPage();
开发者ID:tcsoftwareaustin,项目名称:vint,代码行数:31,代码来源:example_020.php

示例2: Header

$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
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', 'BI', 12);
// add a page
$pdf->AddPage();
$pdf->AddPage();
// set some text to print
$txt = <<<EOD
TCPDF Example 003

Custom page header and footer are defined by extending the TCPDF class and overriding the Header() and Footer() methods.
EOD;
// print a block of text using Write()
$pdf->Write($h = 0, $txt, $link = '', $fill = 0, $align = 'C', $ln = true, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_003.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
开发者ID:lanzelotik,项目名称:celestic-community,代码行数:31,代码来源:example_003.php

示例3: dirname

$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)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', '', 12);
// add a page
$pdf->AddPage();
// set some text to print
$txt = <<<EOD
TCPDF Example 003

Custom page header and footer are defined by extending the TCPDF class and overriding the Header() and Footer() methods.
EOD;
// print a block of text using Write()
$pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_003.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
开发者ID:acristopherd,项目名称:scholarship,代码行数:31,代码来源:scholar_grade_pdf.php

示例4:

 $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
 //$pdf->setLanguageArray($l);
 // ---------------------------------------------------------
 $pdf->SetFont('times', 'B', 17);
 // add a page
 $pdf->AddPage();
 $pdf->SetTextColor(190);
 $pdf->SetY(5);
 $pdf->Write(10, 'Facture ' . $id_ventes . ' ', '', 0, 'R', true);
 /*écriture "ACQUITTEE"
 if ($donnees['paiement']==1){
 $pdf->SetFont('times', '', 49);
 $pdf->SetY(10);
 $pdf->SetTextColor(250,0,0);
 $pdf->Write(10, 'ACQUITTE','',0, 'R',true);
 }
 */
 $pdf->SetFont('times', '', 9);
 $pdf->SetY(30);
 $pdf->SetTextColor(0);
 // set columns width
 $first_column_width = 100;
 $second_column_width = 60;
 // get current vertical position
开发者ID:kidsinhalf,项目名称:valocal,代码行数:31,代码来源:facture.php

示例5: dirname

$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// fijar auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// fijar image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// establecer lenguajes
if (@file_exists(dirname(__FILE__) . '/lang/spa.php')) {
    require_once dirname(__FILE__) . '/lang/spa.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// establecer el font
$pdf->SetFont('helvetica', 'B', 20);
// agregar una página
$pdf->AddPage();
$pdf->Write(0, 'Catálogo', '', 0, 'L', true, 0, false, false, 0);
$pdf->SetFont('helvetica', '', 8);
//---------------------------------
$tbl = <<<EOD
<table border="1"  cellpadding="0" cellspacing="1" align="center" fontsize="14">
<tr>
<td></td><td><br /><br /><br /><br /></td>
</tr>
<tr>
<th colspan="2"><h1>Estructura Programática</h1></th>
</tr>
</table>
EOD;
$pdf->writeHTML($tbl, true, false, false, false, '');
$pdf->Ln();
$pdf->SetLineStyle(array('width' => 0.0, 'cap' => 'butt', 'join' => 'miter', 'dash' => 4, 'color' => array(255, 0, 0)));
开发者ID:jkarlos1402,项目名称:DGIMy,代码行数:31,代码来源:ejem_pdf.php

示例6: dirname

$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)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'B', 20);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Hoja de Vida Equipo de computo', '', 0, 'C', true, 0, false, false, 0);
$pdf->SetFont('helvetica', '', 8);
// -----------------------------------------------------------------------------
$idemp = $_POST["idemp"];
$nombre_emp = $_POST["nombre_emp"];
$idcom = $_POST["idcom"];
$tipopc = $_POST["tipopc"];
$activo = $_POST["activo"];
$procesador = $_POST["procesador"];
$ram = $_POST["ram"];
$dd = $_POST["dd"];
$dvd = $_POST["dvd"];
$puertos = $_POST["puertos"];
$caracteristicas = $_POST["caracteristicas"];
$so = $_POST["so"];
$licencia = $_POST["licencia"];
开发者ID:edmalagon,项目名称:operlog,代码行数:31,代码来源:reporte5.php

示例7: dirname

$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 some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', 'B', 14);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'FACTURA', '', 0, 'C', 1, 0, false, false, 0);
$pdf->SetFont('times', 'B', 27);
$pdf->Write(0, 'FACTURA', '', 0, 'C', 1, 0, false, false, 0);
$pdf->SetFont('times', 'B', 14);
// set some text to print
$html = <<<EOD

<p>

Corp. Ivan</p>
EOD;
// print a block of text using Write()
//$pdf->writeHTMLCell(0, $txt, '', 0, 'C', true, 0, false, false, 0);
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
// ---------------------------------------------------------
//Close and output PDF document
开发者ID:Vrian7ipx,项目名称:repocas,代码行数:31,代码来源:example_013.php

示例8: ProcessRequest

    function ProcessRequest()
    {
        // $pdf = $this->Pdf;
        //============================================================+
        // File name   : example_003.php
        // Begin       : 2008-03-04
        // Last Update : 2013-05-14
        //
        // Description : Example 003 for TCPDF class
        //               Custom Header and Footer
        //
        // Author: Nicola Asuni
        //
        // (c) Copyright:
        //               Nicola Asuni
        //               Tecnick.com LTD
        //               www.tecnick.com
        //               info@tecnick.com
        //============================================================+
        /**
         * Creates an example PDF TEST document using TCPDF
         * @package com.tecnick.tcpdf
         * @abstract TCPDF - Example: Custom Header and Footer
         * @author Nicola Asuni
         * @since 2008-03-04
         */
        // Include the main TCPDF library (search for installation path).
        // require_once('tcpdf_include.php');
        // create new PDF document
        $pdf = new MYPDF(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 003');
        $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, 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)
        if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
            require_once dirname(__FILE__) . '/lang/eng.php';
            $pdf->setLanguageArray($l);
        }
        // ---------------------------------------------------------
        // set font
        $pdf->SetFont('times', 'BI', 12);
        // add a page
        $pdf->AddPage();
        // set some text to print
        $txt = <<<EOD
TCPDF Example 003

Custom page header and footer are defined by extending the TCPDF class and overriding the Header() and Footer() methods.
EOD;
        // print a block of text using Write()
        $pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
        // ---------------------------------------------------------
        //Close and output PDF document
        $pdf->Output('example_003.pdf', 'I');
        //============================================================+
        // END OF FILE
        //============================================================+
        // $this->Save();
    }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:77,代码来源:ViewPdfx3.pdfx.class.php

示例9:

 $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
 //$pdf->setLanguageArray($l);
 // ---------------------------------------------------------
 $pdf->SetFont('times', 'B', 17);
 // add a page
 $pdf->AddPage();
 $pdf->SetTextColor(190);
 $pdf->SetY(5);
 $pdf->Write(10, 'Numéro d\'ordre du reçu : ' . $id_achats . ' ', '', 0, 'R', true);
 /*écriture "ACQUITTEE"
 if ($donnees['paiement']==1){
 $pdf->SetFont('times', '', 49);
 $pdf->SetY(10);
 $pdf->SetTextColor(250,0,0);
 $pdf->Write(10, 'ACQUITTE','',0, 'R',true);
 }
 */
 $pdf->SetFont('times', '', 9);
 $pdf->SetY(30);
 $pdf->SetTextColor(0);
 // set columns width
 $first_column_width = 100;
 $second_column_width = 60;
 // get current vertical position
开发者ID:kidsinhalf,项目名称:valocal,代码行数:31,代码来源:recu.php


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