PHPackages                             famelo/pdf - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. famelo/pdf

ActiveNeos-package[PDF &amp; Document Generation](/categories/documents)

famelo/pdf
==========

Provides a quick and simple way to generate a PDF from a Fluid Template through the MPDF library

4.3.1(1y ago)1874.9k↓61.4%19[1 issues](https://github.com/mneuhaus/Famelo.PDF/issues)LGPL-3.0-or-laterPHP

Since Mar 29Pushed 1y ago6 watchersCompare

[ Source](https://github.com/mneuhaus/Famelo.PDF)[ Packagist](https://packagist.org/packages/famelo/pdf)[ RSS](/packages/famelo-pdf/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

Famelo.PDF
==========

[](#famelopdf)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d54ab152e2bb889911c76a1bfdb3ebeba8a7c9ed88f7de2ecf4f0ea01ab6bedf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6e6575686175732f46616d656c6f2e5044462f6261646765732f7175616c6974792d73636f72652e706e673f733d62366332323933383530326263393831333236393765326239386233333432396233613035313434)](https://scrutinizer-ci.com/g/mneuhaus/Famelo.PDF/)

This package provides a quick and simple way to generate a PDF from a Fluid Template through the [MPDF](http://mpdf1.com) library

Example:

```
$document = new \Famelo\PDF\Document('My.Package:SomeDocument');
$document->assign('someVariable', 'foobar');

// Trigger a Download and exit
$document->download('SomeDocument ' . date('d.m.Y') . '.pdf');

// Show the document inline and exit
$document->send();

// Save the document to a local file
$document->save('/Some/Path/SomeDocument ' . date('d.m.Y') . '.pdf');
```

This example will render a template located at `resource://My.Package/Private/Documents/SomeDocument.html`and convert it to PDF.

Page Format and orientation
---------------------------

[](#page-format-and-orientation)

By default pages will be rendered as a A4 Portrait. You can choose another format/orientation like this:

```
// set format to A5 Portrait
$document = new \Famelo\PDF\Document('My.Package:SomeDocument', 'A5');

// set format to an A4 Landscape
$document->setFormat('A4-L');

// set format to 100mm x 200mm
$document->setFormat([100, 200]);
```

The MPDF library supports different page sizes with these keywords or an array containing 2 values for width + height:

- A0 - A10
- B0 - B10
- C0 - C10
- 4A0
- 2A0
- RA0 - RA4
- SRA0 - SRA4
- Letter
- Legal
- Executive
- Folio
- Demy
- Royal
- Ledger
- Tabloid\*

All of the above values can be suffixed with "-L" to force a Landscape page orientation document e.g. "A4-L". If format is defined as a string, the final orientation parameter will be ignored.

\*Ledger and Tabloid are standard formats with the same page size but different orientation (Ledger is landscape, and Tabloid is portrait). mPDF treats these identically; if you wish to use Ledger, you should specify "Ledger-L" for landscape.

Page numbering in Fluid
-----------------------

[](#page-numbering-in-fluid)

If you want to use mPDFs page numbering variables like `{PAGENO}` or `{nbpg}` you have to wrap them in a CDATA section, to keep Fluid from interpreting them as variables.

PDF Generator Implementation
----------------------------

[](#pdf-generator-implementation)

By default this Library uses the MPDF library to generate the PDFs. But you can change the defaultGenerator through the Settings.yaml like this:

```
Famelo:
  PDF:
    # Generator using wkhtmltopdf through knplabs/knp-snappy
    DefaultGenerator: '\Famelo\PDF\Generator\WebkitGenerator'
    DefaultGeneratorOptions:
      Binary: '/usr/local/bin/wkhtmltopdf'
```

Feel free to create and use a generator for your favorite PDF Library And send me a Pull-Request if you think others might like to use it :)

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~326 days

Recently: every ~536 days

Total

12

Last Release

572d ago

Major Versions

1.0.x-dev → 2.0.02016-11-08

2.0.0 → 3.0.02017-03-28

3.1.1 → 4.0.02019-03-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/dab78333e868497b7a31d4f16d8268ab3c9595a8c55a6df17c6620026588b062?d=identicon)[mneuhaus](/maintainers/mneuhaus)

---

Top Contributors

[![kdambekalns](https://avatars.githubusercontent.com/u/95873?v=4)](https://github.com/kdambekalns "kdambekalns (11 commits)")[![mneuhaus](https://avatars.githubusercontent.com/u/316605?v=4)](https://github.com/mneuhaus "mneuhaus (2 commits)")[![CodeLingoBot](https://avatars.githubusercontent.com/u/45469328?v=4)](https://github.com/CodeLingoBot "CodeLingoBot (1 commits)")[![cvette](https://avatars.githubusercontent.com/u/6884391?v=4)](https://github.com/cvette "cvette (1 commits)")[![iseries](https://avatars.githubusercontent.com/u/6272363?v=4)](https://github.com/iseries "iseries (1 commits)")[![koernchen02](https://avatars.githubusercontent.com/u/312900?v=4)](https://github.com/koernchen02 "koernchen02 (1 commits)")[![midalmis](https://avatars.githubusercontent.com/u/45658374?v=4)](https://github.com/midalmis "midalmis (1 commits)")[![philsturgeon](https://avatars.githubusercontent.com/u/67381?v=4)](https://github.com/philsturgeon "philsturgeon (1 commits)")[![albe](https://avatars.githubusercontent.com/u/4259532?v=4)](https://github.com/albe "albe (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![andyhirsch](https://avatars.githubusercontent.com/u/14921186?v=4)](https://github.com/andyhirsch "andyhirsch (1 commits)")

### Embed Badge

![Health badge](/badges/famelo-pdf/health.svg)

```
[![Health](https://phpackages.com/badges/famelo-pdf/health.svg)](https://phpackages.com/packages/famelo-pdf)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

28.0k175.2k9](/packages/bagisto-bagisto)[kimai/kimai

Kimai - Time Tracking

4.8k9.4k1](/packages/kimai-kimai)[neos/neos

An open source Content Application Platform based on Flow. A set of core Content Management features is resting within a larger context that allows you to build a perfectly customized experience for your users.

1151.0M838](/packages/neos-neos)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1617.3k16](/packages/2lenet-crudit-bundle)[neos/media

The Media package

101.2M57](/packages/neos-media)[abydahana/aksara

Aksara is a modern, developer-friendly framework and CMS built on CodeIgniter 4, featuring rapid CRUD development, modular architecture, smart routing, flexible access control, API integration, and an AI assistant to make content management faster and smarter.

1141.2k](/packages/abydahana-aksara)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
