创建PDF模板: Difference between revisions

Jump to navigation Jump to search
Line 90: Line 90:
===插入 logo===
===插入 logo===


*Add following instructions
*添加说明


<source lang="php">
<source lang="php">
$pdf->Image('\www\htdocs\dolibarr\document\societe\logo.jpg', 10, 5, 60.00);
$pdf->Image('\www\htdocs\dolibarr\document\societe\logo.jpg', 10, 5, 60.00);
</source>
</source>
With this example: 10=abscissa, 5=ordinate, 60=with of logo


*If logo is on or outside existing text, remove exisiting text by commenting the code that output the text or by changing its position.
在示例中:10=横坐标,5=纵坐标,60=logo宽度
 
*如果logo位于现有文本的下方或上方,请通过注释掉显示信息的代码或更改其位置来删除现有文本。
 
=== 在发票页面底部插入签名或其他内容 ===
 
*打开要编辑和插入的.php文件
 
<syntaxhighlight lang="PHP">
$pdf->Image(DOL_DOCUMENT_ROOT.'/mydir/signature.jpg',120,250,74);
</syntaxhighlight>
 
图像(74mm宽)显示在页脚前的右栏中。
 
*将图像复制到目录。具有透明度的PNG图像似乎是有问题的。
*生成PDF时,将显示签名。


===插入文本===
===插入文本===
Most comme function to use
使用的主要功能
 
<source lang="php">
<source lang="php">
$pdf->setX(float a); // set current x position
$pdf->setX(float a); // set current x position
Line 109: Line 124:
$pdf->MultiCell(60, 8, 'Mon texte", 0, 'L'); // imprime 'Mon texte' avec saut de ligne
$pdf->MultiCell(60, 8, 'Mon texte", 0, 'L'); // imprime 'Mon texte' avec saut de ligne
</source>
</source>
Note: Origin for setXY functions are the top left corner of page.
 
提醒:setXY 函数的原点位于页面的左上角


==更多信息==
==更多信息==


*List of TCPDF's methods: tcpdf.org/doc/code/classTCPDF.html
*TCPDF函数清单:<nowiki>https://tcpdf.org/docs/srcdoc/</nowiki> 
*


=激活模块=
=激活模块=
714

edits

Navigation menu