简体   繁体   English

TCPDF在html模板中写入自定义条形码

[英]TCPDF write custom barcode in html template

instead of type below in action.class.php : $pdf->write1DBarcode('CODE 39', 'C39', '', '', '', 18, 0.4, '', 'N'); 而不是下面的action.class.php中的类型:$ pdf-> write1DBarcode('CODE 39','C39','','','',18,0.4,'','N');

How can i make it custom so that i can write it in the template? 我如何使其自定义,以便可以在模板中编写它?

the reason is when i have to stamp the same barcode twice in one page...the normal barcode thing can only do it once in a page...please help me wth this...i kindly apreciated it..:D 原因是当我必须在一页中将相同的条形码标记两次时...正常的条形码事情只能在一页中进行一次...请帮助我...我很感激..:D

You can write TCPDF Methods in HTML as below 您可以使用HTML编写TCPDF方法,如下所示

<?php
$params = $pdf->serializeTCPDFtagParameters(array('40144399300102444888207482244309', 'C128C', '', '', 0, 0, 0.2, array('position'=>'S', 'border'=>false, 'padding'=>4, 'fgcolor'=>array(0,0,0), 'bgcolor'=>array(255,255,255), 'text'=>false, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>2), 'N'));    
$str='<table cellspacing="0" cellpadding="1" border="0">            
<tr> 
    <td align="left">barcode</td>
</tr>
<tr> 
    <td align="center" style="padding-left:5px;">';
    $str .= '<tcpdf method="write1DBarcode" params="'.$params.'" />';
    $str .='</td>
</tr>
</table>';

$pdf->writeHTML($str,true, false,false,false,'left');
$pdf->Output('example_049.pdf', 'I');
?>

For detail reference please check TCPDF example_049.php 有关详细信息,请检查TCPDF example_049.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM