kitpages/pdf-bundle

Symfony PdfBundle

Installs: 3 551

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 1

Open Issues: 1

Type:symfony-bundle

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

This package is auto-updated.

Last update: 2024-12-04 20:00:23 UTC


README

Pdf: FPDF and FPDI simple wrapper for Symfony

Installation

use composer update

add the new Bundle in app/appKernel.php

Use example

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, 'modify my pdf'); } $pdf->Output('newPdf.pdf, 'D');