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


PHP TCPDF::setCellPaddings方法代码示例

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


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

示例1: prepareDownloadImagePdf

 public function prepareDownloadImagePdf($filename, $newfilename, $firstname, $lastname, $title, $description, $code, $date_end)
 {
     // calculate date
     $currentDate = new DateTime();
     $currentDate->modify('+ ' . $date_end . ' month');
     $date_end = $currentDate->format('Y-m-d');
     $this->load->model('tool/image');
     require_once DIR_SYSTEM . 'library/tcpdf/tcpdf.php';
     $pdf = new TCPDF();
     // disable auto-page-break
     $pdf->SetAutoPageBreak(false, 0);
     // set image 1
     $pdf->AddPage();
     $pdf->Image(DIR_IMAGE . $filename, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
     $pdf->setPageMark();
     /*if(stripos('.pdf',$newfilename)===false)
       {
           $t = explode('.',$newfilename);
           array_pop($t);
           $newfilename = implode('.',$t).'.pdf';
       }*/
     $pdf->SetFont('times', '', 13);
     $pdf->SetTextColor(50, 50, 50);
     for ($i = 0; $i <= 16; $i++) {
         $pdf->Ln(10);
     }
     $pdf->setCellPaddings(90);
     $pdf->Ln(10);
     $pdf->Write(0, $firstname . ' ' . $lastname);
     $pdf->Ln(10);
     $pdf->Ln(10);
     $pdf->Write(0, $title);
     $pdf->Ln(10);
     $pdf->SetFont('times', '', 11);
     $pdf->Write(0, $description);
     $pdf->setCellPaddings(70);
     $pdf->Ln(10);
     $pdf->Ln(10);
     $pdf->Ln(10);
     $pdf->Ln(10);
     $pdf->Ln(10);
     $pdf->SetFont('times', '', 7);
     $pdf->Write(0, 'Beauty Center Billstedt');
     $pdf->Ln(4);
     $pdf->SetFont('times', 'B', 9);
     $pdf->Write(0, '#' . $code);
     $pdf->Ln(4);
     $pdf->SetFont('times', '', 9);
     $pdf->Write(0, 'Gültig bis:: ' . $date_end);
     $pdf->Output(DIR_IMAGE . $newfilename, 'F');
 }
开发者ID:miechuliv,项目名称:BeautyCenter,代码行数:51,代码来源:download.php

示例2: dc_YDown

/* dc_YDown() */
function dc_YDown($a = 0)
{
    global $pdf;
    $pdf->SetY($pdf->GetY() + $a);
    // Line break 2mm
    return $pdf->GetY();
}
// set JPEG quality
$pdf->setJPEGQuality(75);
// Image method signature:
// Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)
// set font
$pdf->SetFont('dejavusans', '', 11, '', true);
// set cell padding
$pdf->setCellPaddings(0, 0, 0, 0.5);
//$left='', $top='', $right='', $bottom='')
// set cell margins
$pdf->setCellMargins(0, 0, 0, 0);
// set color for background
$pdf->SetFillColor(255, 255, 255);
// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)
// START //////////////////////////
// Queries:
//$t=dbSel("*","catalog","W/`dcid`='$dcid' LIMIT 0,1");
//$ndata=mysql_num_rows($t);
//$r=dbFA($t);
// add a page
$pdf->AddPage();
// define barcode style
$style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => false, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 0, 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 7, 'stretchtext' => 3);
开发者ID:epiii,项目名称:siadu-epiii,代码行数:31,代码来源:printlabel.php

示例3: array

$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetHeaderMargin(1);
$pdf->SetMargins(10, 47, 10);
$pdf->SetFooterMargin(7);
$pdf->SetAutoPageBreak(TRUE, 15);
//$pdf->setFontSubsetting(true);
$pdf->SetFont('Helvetica', '', 8, '', true);
$pdf->setPrintHeader(true);
//no imprime la cabecera ni la linea
$pdf->setPrintFooter(true);
// imprime el pie ni la linea
$pdf->SetHeaderData('img1.png', 180, "", "", array(0, 64, 255), array(0, 64, 128));
$pdf->AddPage();
// set cell padding
$pdf->setCellPaddings(0, 0, 2, 0);
// set cell margins
$pdf->setCellMargins(0.5, 0.5, 0.5, 0.5);
//*************
ob_end_clean();
//rompimiento de pagina
//*************
$cadena = '';
//$cadena .= '<center><div><img src="img10.png" alt="attribute" width="500" height="150" border="0" ></div></center>';
$cadena .= $_SESSION['encabezado_tabla'];
$cadena .= $_SESSION['cuerpo_tabla'];
foreach ($mis_pines as $p) {
    $uni = substr($p['u'], 0, -6);
    switch ($uni) {
        case "uvsf":
            if ($p['fecha_de_creacion_pin'] != '') {
开发者ID:japeto,项目名称:PollSystem,代码行数:31,代码来源:impresora2100.php

示例4:

// 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 default font subsetting mode
$pdf->setFontSubsetting(true);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 12);
// add a page
// set cell padding
$pdf->setCellPaddings(1, 1, 1, 1);
// set cell margins
$pdf->setCellMargins(0, 1, 0, 1);
// set font color
$pdf->SetTextColor(50, 50, 50);
$pdf->SetFillColor(238, 238, 238);
$pdf->AddPage();
//	 Transparancy Image Stamp
//	if(!empty($dx_invoice_stamp_img)){
//		$pdf->Image($dx_invoice_stamp_img, 18, 15, 16, '', '', 'http://Dxinvoice.com', '', false, 300);
//	}
// Transparancy Image Stamp
if (!empty($dx_invoice_stamp_img)) {
    $pdf->Image($dx_invoice_stamp_img, $dx_stamp_position, 130, 30, '', '', '', '', false, 300);
}
//if(!empty($dx_invoice_signature_img))
开发者ID:sutandang,项目名称:DX-Invoicer,代码行数:31,代码来源:dx-pdf-process.php

示例5: showPdf


//.........这里部分代码省略.........
    while ($db->next_record()) {
        $idRelNome = $db->f(id_rel_nome);
        $idNome = $db->f(id_nome);
        $idUbica = $db->f(id_ubicacion);
        $idDime = $db->f(id_dimension);
        $nome = getValueTable("nombre", "NOMENCLATURA", "id_nome", $idNome);
        $nomeCode = getValueTable("codigo", "NOMENCLATURA", "id_nome", $idNome);
        $ubica = getValueTable("ubicacion", "UBICACION", "id_ubicacion", $idUbica);
        $dimen = getValueTable("dimension", "DIMENSION", "id_dimension", $idDime);
        $dano .= "{$nome} ({$nomeCode}) : {$ubica} : {$dimen}\n";
    }
    $dano = nl2br($dano);
    // ---------------------------------------------------------
    // DATOS DEL RECIBO
    // ---------------------------------------------------------
    if ($noRecibo > 0) {
        $subTotal = $maniCosto + $repaCosto;
        $total = $subTotal;
        $subTotal = number_format($subTotal, 2);
        $total = number_format($total, 2);
        $datoRecibo = "\n        <table cellspacing=\"0\" cellpadding=\"3\" border=\"1\" align=\"center\">    \n        <tr>\n        <td colspan=\"4\" valign=\"middle\"><b>DEPOSITO DE CONTENEDORES OPEMANTRA</b></td>\n        <td>\n        <table cellspacing=\"1\" cellpadding=\"2\" border=\"0\" align=\"center\">    \n        <tr>\n        <td bgcolor=\"black\"><b><font color=\"white\">FOLIO</font></b></td>\n        </tr>\n        <tr>\n        <td><font color=\"red\"><b>No. {$noRecibo}</b></font></td>\n        </tr>\n        </table>\n        </td>\n        </tr>    \n        <tr>\n        <td><b>FECHA</b></td>\n        <td><b>No.R.I.E.</b></td>                \n        <td></td>\n        <td><b>CONTENEDOR</b></td>\n        <td><b>TIPO</b></td>\n        </tr>\n        <tr>\n        <td>{$capFec}</td>        \n        <td>{$idReg}</td>\n        <td></td>\n        <td>{$conteL}{$conteN}</td>\n        <td>{$equipo}</td>\n        </tr>    \n        <tr>\n        <td><b>CONCEPTO</b></td>                \n        <td><b>TRANSPORTISTA</b></td>        \n        <td><b>OPERADOR</b></td>\n        <td colspan=\"2\"><b>OBSERVACIONES</b></td>        \n        </tr>             \n        <tr>    \n        <td>{$tipoManiTx}</td>        \n        <td>{$transp}</td>\n        <td>{$operador}</td> \n        <td colspan=\"2\">{$docu} {$docuRef} / {$nota}</td>               \n        </tr>\n        </table>\n        <table cellspacing=\"0\" cellpadding=\"3\" border=\"1\" align=\"center\">\n        <tr>\n        <td ><b>FIRMA OPERADOR</b></td>\n        <td ><b>FIRMA DEL DEPOSITO</b></td>\n        <td>\n        <table cellspacing=\"0\" cellpadding=\"3\" border=\"1\" align=\"center\">\n        <tr>\n        <td align=\"right\"><b>MANIOBRA \$</b></td>\n        <td align=\"right\">{$maniCosto}</td>\n        </tr>\n        <tr>\n        <td align=\"right\"><b>REPARACIONES \$</b></td>\n        <td align=\"right\">{$repaCosto}</td>\n        </tr>            \n        <tr>\n        <td align=\"right\"><b>TOTAL \$</b></td>\n        <td align=\"right\">{$total}</td>\n        </tr>\n        </table>\n        </td>\n        </tr>\n        ";
        if ($docTipo == "EFECTIVO") {
            $datoRecibo .= "\n            <tr>  \n            <td colspan=\"3\" align=\"right\">RECIBIMOS DE <u>{$operador}</u> LA CANTIDAD DE {$montoLetra} PESOS M.N. 00/100 </td>\n            </tr>\n            ";
        }
        $datoRecibo .= "</table>";
    }
    // -------------------------------------------------------------------
    $pdf->AddPage();
    // Logo
    $pdf->setJPEGQuality(100);
    $pdf->Image('../images/logo.jpg', 13, 4, 60, 30, '', '', '', false);
    //$pdf->Image('../images/nome.jpg', 15, 145, 185, 120,'','','',false);
    // set cell padding
    $pdf->setCellPaddings(1, 1, 1, 1);
    // set cell margins
    $pdf->setCellMargins(1, 1, 1, 1);
    // Encabezado
    $pdf->SetFillColor(197, 197, 197);
    // Trebol
    $pdf->SetFont('helvetica', '', 14);
    $pdf->MultiCell(65, 4, $txt, 0, 'L', 0, 0, 40, 10, true);
    //$txt="Av. ";
    $pdf->SetFont('helvetica', '', 7);
    $pdf->MultiCell(60, 4, $txt, 0, 'C', 0, 0, 105, 10, true);
    $pdf->SetFont('helvetica', '', 12);
    $tbl = <<<EOD
<table cellspacing="0" cellpadding="3" border="0" align="center">
    <tr bgcolor="#cacaca">
        <th>FOLIO</th>
    </tr>
    <tr>    \t
    \t<td><font color="red">S {$eir}</font></td>
    </tr>
</table>
EOD;
    $pdf->writeHTML($tbl, true, false, false, false, '');
    $txt = "RECIBO DE INTERCAMBIO DE EQUIPO (R.I.E)";
    $pdf->SetFont('helvetica', 'B', 12);
    $pdf->MultiCell(100, 4, $txt, 0, 'C', 0, 0, 60, 37, true);
    $pdf->SetFont('helvetica', '', 8);
    $tbl = <<<EOD
<br><br><br>
<table cellspacing="0" cellpadding="3" border="0" align="center">
    <tr>
        <th><b>CONTENEDOR</b></th>
        <th><b>CARACTERISTICAS FISICAS</b></th>
开发者ID:nesmaster,项目名称:anakosta,代码行数:67,代码来源:eirPdfSalPlus.php

示例6: dirname

// 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', '', 10);
// add a page
$pdf->AddPage();
// set cell padding
$pdf->setCellPaddings(1, 1, 1, 1);
// set cell margins
$pdf->setCellMargins(1, 1, 1, 1);
// set color for background
$pdf->SetFillColor(255, 255, 127);
// 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 some text for example
$txt = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
//$final = $pdf->write2DBarcode('7024736019|3|2104002021751|2015-10-02|30.50|30.50|15451254|0|0|0|0', 'QRCODE,L', '', '', 30, 30, '', 'N');
// Multicell test
$pdf->MultiCell(55, 5, '[LEFT] ' . $txt, 1, 'L', 1, 0, '', '', true);
$pdf->MultiCell(55, 5, '[RIGHT] ' . $txt, 1, 'R', 0, 1, '', '', true);
$pdf->MultiCell(55, 5, '[CENTER] ' . $txt, 1, 'C', 0, 0, '', '', true);
$pdf->MultiCell(55, 5, '[JUSTIFY] ' . $txt . "\n", 1, 'J', 1, 2, '', '', true);
$pdf->MultiCell(55, 5, '[DEFAULT] ' . $txt, 1, '', 0, 1, '', '', true);
$pdf->Ln(4);
开发者ID:Vrian7ipx,项目名称:repocas,代码行数:31,代码来源:example_005.php

示例7:

$cy=dc_YDown($a);
$pdf->Line($x1,$cy,$x2,$cy);
$cy=dc_YDown($b);
}

// set JPEG quality
$pdf->setJPEGQuality(75);

// Image method signature:
// Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)

// set font
$pdf->SetFont(mydeffont, '', 11, '', true);

// set cell padding
$pdf->setCellPaddings(0, 0, 0, 0.5); //$left='', $top='', $right='', $bottom='')

// set cell margins
$pdf->setCellMargins(0, 0, 0, 0);

// set color for background
$pdf->SetFillColor(255, 255, 255);

// 1. Parameter: sesuaikan dg parameter di Page Selection Bar >> Edit
$cid=gets('token');
$lap_cetak=gets('lap_cetak',0);
$lap_tglcetak=gets('lap_tglcetak',0);
$lap_sum=gets('lap_sum',0);

// 2. Queries: samakan dg Query >> Edit
$t=mysql_query("SELECT * FROM pus_stockhist WHERE replid='$cid'");
开发者ID:nickohappy7,项目名称:sister,代码行数:31,代码来源:stocktake.php

示例8: addressLabelPDF

 function addressLabelPDF($outputformat)
 {
     $pdf = new TCPDF('L', 'mm', 'A4', true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Niels Klazenga');
     $pdf->SetTitle('MEL Label');
     $pdf->SetSubject('MEL Label');
     //set margins
     $pdf->SetTopMargin(7.5);
     //set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, 0);
     // remove default header/footer
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     // ---------------------------------------------------------
     // set font
     if ($outputformat == 3) {
         $pdf->SetFont('helvetica', '', 12);
     } else {
         $pdf->SetFont('helvetica', '', 14);
     }
     // set cell padding
     $pdf->setCellPaddings(0, 0, 0, 0);
     // set cell margins
     $pdf->setCellMargins(0, 0, 0, 0);
     $pdf->addPage();
     if ($outputformat == 3) {
         $x = 135;
         $y = 40;
     } else {
         $x = 165;
         $y = 30;
     }
     $this->Address();
     $pdf->MultiCell(100, 5, $this->loan->ShippedTo, 0, 'L', 0, 1, $x, $y, true, false, true);
     // move pointer to last page
     $pdf->lastPage();
     // ---------------------------------------------------------
     //Close and output PDF document
     $pdf->Output('mellabel.pdf', 'I');
 }
开发者ID:rbgvictoria,项目名称:melisr,代码行数:42,代码来源:exchange.php

示例9: 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 005');
        $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 . ' 005', 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('times', '', 10);
        // add a page
        $pdf->AddPage();
        // set cell padding
        $pdf->setCellPaddings(1, 1, 1, 1);
        // set cell margins
        $pdf->setCellMargins(1, 1, 1, 1);
        // set color for background
        $pdf->SetFillColor(255, 255, 127);
        // 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 some text for example
        $txt = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
        // Multicell test
        $pdf->MultiCell(55, 5, '[LEFT] ' . $txt, 1, 'L', 1, 0, '', '', true);
        $pdf->MultiCell(55, 5, '[RIGHT] ' . $txt, 1, 'R', 0, 1, '', '', true);
        $pdf->MultiCell(55, 5, '[CENTER] ' . $txt, 1, 'C', 0, 0, '', '', true);
        $pdf->MultiCell(55, 5, '[JUSTIFY] ' . $txt . "\n", 1, 'J', 1, 2, '', '', true);
        $pdf->MultiCell(55, 5, '[DEFAULT] ' . $txt, 1, '', 0, 1, '', '', true);
        $pdf->Ln(4);
        // set color for background
        $pdf->SetFillColor(220, 255, 220);
        // Vertical alignment
        $pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - TOP] ' . $txt, 1, 'J', 1, 0, '', '', true, 0, false, true, 40, 'T');
        $pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - MIDDLE] ' . $txt, 1, 'J', 1, 0, '', '', true, 0, false, true, 40, 'M');
        $pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - BOTTOM] ' . $txt, 1, 'J', 1, 1, '', '', true, 0, false, true, 40, 'B');
        $pdf->Ln(4);
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // set color for background
        $pdf->SetFillColor(215, 235, 255);
        // set some text for example
        $txt = '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 a blox of text using multicell()
        $pdf->MultiCell(80, 5, $txt . "\n", 1, 'J', 1, 1, '', '', true);
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // AUTO-FITTING
        // set color for background
        $pdf->SetFillColor(255, 235, 235);
        // Fit text on cell by reducing font size
        $pdf->MultiCell(55, 60, '[FIT CELL] ' . $txt . "\n", 1, 'J', 1, 1, 125, 145, true, 0, false, true, 60, 'M', true);
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // CUSTOM PADDING
        // set color for background
        $pdf->SetFillColor(255, 255, 215);
        // set font
        $pdf->SetFont('helvetica', '', 8);
        // set cell padding
        $pdf->setCellPaddings(2, 4, 6, 8);
        $txt = "CUSTOM PADDING:\nLeft=2, Top=4, Right=6, Bottom=8\nLorem 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.\n";
        $pdf->MultiCell(55, 5, $txt, 1, 'J', 1, 2, 125, 210, true);
        // move pointer to last page
        $pdf->lastPage();
        $this->comparePdfs($pdf);
    }
开发者ID:fooman,项目名称:tcpdf,代码行数:84,代码来源:Example005Test.php

示例10: printVrsBarcodeLabelRecordSet

 function printVrsBarcodeLabelRecordSet($props, $barcodes, $start = 0)
 {
     $numx = $props['numx'];
     $numy = $props['numy'];
     $labelheight = $props['dimensions']['labelheight'];
     $labelwidht = $props['dimensions']['labelwidth'];
     $labelheader_pos = $props['dimensions']['labelheader_pos'];
     $labelbody_pos = $props['dimensions']['labelbody_pos'];
     $numlabels = $numx * $numy;
     $barcode_pos = $props['dimensions']['barcode_pos'];
     $barcodetext_pos = $props['dimensions']['barcodetext_pos'];
     set_time_limit(600);
     // create new PDF document
     $pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Niels Klazenga');
     $pdf->SetTitle('MEL Label');
     $pdf->SetSubject('MEL Label');
     //set margins
     $pdf->SetMargins(5, 7.5, 5);
     //set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, 3);
     // remove default header/footer
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', '', 9);
     // set cell padding
     $pdf->setCellPaddings(0, 0, 0, 0);
     // set cell margins
     $pdf->setCellMargins(0, 0, 0, 0);
     $barcodestyle = array('position' => '', 'padding' => 0, 'align' => 'C', 'stretch' => true, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => false);
     if ($start > 0) {
         $pdf->AddPage();
     }
     for ($i = 0; $i < count($barcodes); $i++) {
         $j = $i + $start;
         $offset = $j % ($numx * $numy);
         $x = $offset % $numx;
         $y = floor($offset / $numx);
         if ($j % $numlabels == 0) {
             $pdf->AddPage();
         }
         $pdf->MultiCell(55, 5, '<b>Victorian Reference Set</b>', 0, 'C', 0, 1, $barcodetext_pos['x'][$x], $barcode_pos['y'][$y] - 3, true, false, true);
         $vrsnumber = $barcodes[$i]['Barcode'];
         $pdf->write1DBarcode($vrsnumber, 'C39', $barcode_pos['x'][$x], $barcode_pos['y'][$y], 55, 8, 0.1, $barcodestyle, 'N');
         $pdf->MultiCell(55, 5, '<b>' . $vrsnumber . '</b>', 0, 'C', 0, 1, $barcodetext_pos['x'][$x], $barcodetext_pos['y'][$y] - 4, true, false, true);
         $pdf->MultiCell(55, 5, 'Duplicate of ' . $barcodes[$i]['MELNumber'], 0, 'C', 0, 1, $barcodetext_pos['x'][$x], $barcodetext_pos['y'][$y], true, false, true);
     }
     // move pointer to last page
     $pdf->lastPage();
     // ---------------------------------------------------------
     // Close and output PDF document
     $pdf->Output('mellabel.pdf', 'I');
 }
开发者ID:rbgvictoria,项目名称:melisr,代码行数:57,代码来源:melisrlabels.php


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