PHPackages                             surda/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. surda/pdf

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

surda/pdf
=========

PDF bulder

v2.0.0(5y ago)071MITPHPPHP &gt;=8.0

Since Oct 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/surda/pdf)[ Packagist](https://packagist.org/packages/surda/pdf)[ Docs](http://surani.cz)[ RSS](/packages/surda-pdf/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (10)Versions (4)Used By (0)

PDF builder into Nette Framework
================================

[](#pdf-builder-into-nette-framework)

---

[![Build Status](https://camo.githubusercontent.com/1b8bbb54c59f23cd44db80fd6da75590fdb53ce1dfd28dfa78a0b058288377c3/68747470733a2f2f7472617669732d63692e6f72672f73757264612f7064662e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/surda/pdf)[![Licence](https://camo.githubusercontent.com/b7989f3e1efabd0e00b321134817d99c79e51cc109376ec70116849ff406d81d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73757264612f7064662e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/surda/pdf)[![Latest stable](https://camo.githubusercontent.com/a53c533518fd3a510f7c8898a1e67f34166b3fab8125443ccb88d39a7fa5a680/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73757264612f7064662e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/surda/pdf)[![PHPStan](https://camo.githubusercontent.com/441b5874ce4df0a2defc892979c96c46889b69cb32119d04f0b48626349f8bc9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/phpstan/phpstan)

Installation
------------

[](#installation)

The recommended way to is via Composer:

```
composer require surda/pdf

```

After that you have to register extension in config.neon:

```
extensions:
    pdf: Surda\Pdf\DI\PdfExtension
```

Configuration
-------------

[](#configuration)

Default

```
pdf:
    template:
        defaults:
            layout: @@default
        config:
            layout: @@default
```

Usage
-----

[](#usage)

### Builder

[](#builder)

```
/** @var Surda\Pdf\IPdfBuilderFactory @inject */
public $pdfBuilderFactory;
```

```
// Builder
$builder = $this->pdfBuilderFactory->create();

// Template
$builder->setTemplateFile(__DIR__ . '/path/to/template.latte');
$builder->setParameters([
    'foo' => 'World!',
]);

// Get Mpdf
$mpdf = $builder->getMpdf();

$this->sendResponse(new PdfResponse($mpdf->Output('file.pdf', \MPdf\Output\Destination::DOWNLOAD)));
```

### Template

[](#template)

Each template has many internal variables:

- `$_defaults` - refer default configuration
- `$_config` - refer custom configuration

```
{layout defaults->layout}

{block #content}
    Hello, {$foo}
{/block}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~271 days

Total

3

Last Release

1867d ago

Major Versions

v1.1.0 → v2.0.02021-04-03

PHP version history (3 changes)v1.0.0PHP &gt;=7.1

v1.1.0PHP &gt;=7.1,&lt;8.0

v2.0.0PHP &gt;=8.0

### Community

Maintainers

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

---

Top Contributors

[![surda](https://avatars.githubusercontent.com/u/588663?v=4)](https://github.com/surda "surda (4 commits)")

---

Tags

pdfnette

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[contributte/pdf

Pdf response extension for Nette Framework

43967.8k2](/packages/contributte-pdf)[carlos-meneses/laravel-mpdf

Laravel Mpdf: Using Mpdf in Laravel to generate Pdfs.

4403.1M7](/packages/carlos-meneses-laravel-mpdf)[kartik-v/yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.

1605.5M84](/packages/kartik-v-yii2-mpdf)[kdyby/wkhtmltopdf

Wkhtmltopdf cli wrapper for Nette Framework

3966.0k](/packages/kdyby-wkhtmltopdf)[tomaj/nette-api

Nette api

36261.8k4](/packages/tomaj-nette-api)[robregonm/yii2-pdf

Yii 2 PDF Response Formatter

4647.5k1](/packages/robregonm-yii2-pdf)

PHPackages © 2026

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