kitpages/pdf-bundle

Symfony PdfBundle

安装数: 3,546

依赖项: 0

建议者: 0

安全性: 0

星标: 2

关注者: 3

分支: 1

开放问题: 1

类型:symfony-bundle

dev-master 2013-05-15 13:12 UTC

This package is auto-updated.

Last update: 2024-09-04 19:28:19 UTC


README

Pdf: FPDF和FPDI的简单封装,用于Symfony

安装

使用composer update

在app/appKernel.php中添加新的Bundle

使用示例

use Kitpages\PDFBundle\lib\PDF;

$pdf = new PDF(); $pagecount = $pdf->setSourceFile('oldPdf.pdf');

for($i = 1; $i <= $pagecount; $i++){ $tplIdx = $pdf->importPage($i); $s = $pdf->getTemplatesize($tplIdx); $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L', array($s['w'], $s['h']), true); // This gets it the right dimensions $pdf->useTemplate($tplIdx, 0, 0, 0, 0, true); $pdf->SetFont('Arial','',8); $pdf->SetTextColor(168,168,168); $pdf->SetY(20); $pdf->SetX(80); $pdf->Write(0, '修改我的PDF'); } $pdf->Output('newPdf.pdf, 'D');