PHPackages                             royopa/fpdf-symfony2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. royopa/fpdf-symfony2

ActiveLibrary

royopa/fpdf-symfony2
====================

fpdf vendor for use with symfony, based on toooni/fpdf

4.0(5y ago)28373.8k↓10.9%13MITPHP &gt;=5.3.3

Since Jul 17Pushed 5y ago2 watchersCompare

[ Source](https://github.com/royopa/fpdf-symfony2)[ Packagist](https://packagist.org/packages/royopa/fpdf-symfony2)[ Docs](https://github.com/royopa/fpdf-symfony2)[ RSS](/packages/royopa-fpdf-symfony2/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

FPDF for use with Symfony
=========================

[](#fpdf-for-use-with-symfony)

Uses FPDF 1.8 and FPDI 2.3, tested in Symfony 2+ and 3+

[![Build Status](https://camo.githubusercontent.com/e639daa85ba9dd18ec10c02b06cca6a9d3ba5614373290b540a27ba2ba757eb9/68747470733a2f2f7472617669732d63692e6f72672f726f796f70612f667064662d73796d666f6e79322e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/royopa/fpdf-symfony2)[![Latest Stable Version](https://camo.githubusercontent.com/81d1dc8d06f8bcb05ff1dff791e8e8d0671601c6b5c7854b1af03fd8b618c830/68747470733a2f2f706f7365722e707567782e6f72672f726f796f70612f667064662d73796d666f6e79322f762f737461626c652e737667)](https://packagist.org/packages/royopa/fpdf-symfony2) [![Total Downloads](https://camo.githubusercontent.com/b6dea96904e958699437a06ea13b50c80c5c7316e244deb5b5a86ad2c81a12c0/68747470733a2f2f706f7365722e707567782e6f72672f726f796f70612f667064662d73796d666f6e79322f646f776e6c6f6164732e737667)](https://packagist.org/packages/royopa/fpdf-symfony2) [![Latest Unstable Version](https://camo.githubusercontent.com/a298fa57cb6ca4f2f2b9da6091a5c19d6d0e8b2886ac293ae617707868b2a41f/68747470733a2f2f706f7365722e707567782e6f72672f726f796f70612f667064662d73796d666f6e79322f762f756e737461626c652e737667)](https://packagist.org/packages/royopa/fpdf-symfony2) [![License](https://camo.githubusercontent.com/66dfc3f24f49092ea0522bc52c96dd4c06f7eefc696e50e623f18a7a768c1aa8/68747470733a2f2f706f7365722e707567782e6f72672f726f796f70612f667064662d73796d666f6e79322f6c6963656e73652e737667)](https://packagist.org/packages/royopa/fpdf-symfony2)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/74be4a9bb469160dc2000fc54e2455b610a06451276f0f6b2186c885fbb220bd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726f796f70612f667064662d73796d666f6e79322f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/royopa/fpdf-symfony2/?branch=master)

Instalation and Usage
---------------------

[](#instalation-and-usage)

Package available on [Composer](https://packagist.org/packages/royopa/fpdf-symfony2).

If you're using Composer to manage dependencies, you can use

```
composer require royopa/fpdf-symfony2
```

Usage
-----

[](#usage)

```
class WelcomeController extends Controller
{
    public function indexAction()
    {
        $pdf = new \FPDF();

        $pdf->AddPage();
        $pdf->SetFont('Arial','B',16);
        $pdf->Cell(40,10,'Hello World!');

        return new Response($pdf->Output(), 200, array(
            'Content-Type' => 'application/pdf'));
    }
}
```

FPDF
----

[](#fpdf)

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. FPDF is a open source project: you may use it for any kind of usage and modify it to suit your needs.

-

On the fpdf homepage you will find links to the documentation, forums and so on.

Example
-------

[](#example)

My Controller:

```
