dev-master
9999999-dev https://github.com/kitpages/KitpagesPDFBundleSymfony PdfBundle
BSD
The Requires
- php >=5.3.2
- symfony/framework-bundle *
by Sebastien Lefebvre
pdf fpdf fpdi
Symfony PdfBundle
Pdf: FPDF and FPDI simple wrapper for Symfony, (*1)
use composer update, (*2)
add the new Bundle in app/appKernel.php, (*3)
use Kitpages\PDFBundle\lib\PDF;, (*4)
$pdf = new PDF(); $pagecount = $pdf->setSourceFile('oldPdf.pdf);, (*5)
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, 'modify my pdf'); } $pdf->Output('newPdf.pdf, 'D');, (*6)
Symfony PdfBundle
BSD
pdf fpdf fpdi