rudissaar / yii2-fpdf
FPDF 插件和 Yii2 框架的包装器。
v1.1.7
2018-01-16 13:23 UTC
Requires
README
FPDF 插件和 Yii2 框架的包装器。
入门指南
FPDF
FPDF
是 FPDF 类的副本,并具有所有方法和属性,与原始版本相同。要在 PHP 文件中包含 FPDF 类,请将以下行添加到您的文件中:
use rudissaar\fpdf\FPDF;
之后,您可以在文件中的任何位置使用 FPDF 类,或者从它继承另一个类。
基本用法
<?php
...
use rudissaar\fpdf\FPDF;
...
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 15);
$pdf->Cell(40, 10, 'Hello World');
$pdf->Output('F', '/tmp/hello.pdf');
...
FPDFPlus (增强类)
此包包含一些额外的方法,这些方法对您可能非常有用。
查看源代码: FPDFPlus
基本用法
<?php
...
use rudissaar\fpdf\FPDFPlus;
...
$pdf = new FPDFPlus();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 15);
$pdf->WriteLnEncoded(10, 'Apple: £10');
$pdf->Output('F', '/tmp/price.pdf');
...