PHPackages                             symbiote/silverstripe-pdfrendition - 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. symbiote/silverstripe-pdfrendition

ActiveSilverstripe-vendormodule[PDF &amp; Document Generation](/categories/documents)

symbiote/silverstripe-pdfrendition
==================================

A module that makes use of the Flying Saucer XHTML renderer project to create PDFs from XHTML pages.

2.1.1(5y ago)175.0k10[4 PRs](https://github.com/nyeholt/silverstripe-pdfrendition/pulls)BSD-3-ClausePHP

Since Jul 6Pushed 1y ago2 watchersCompare

[ Source](https://github.com/nyeholt/silverstripe-pdfrendition)[ Packagist](https://packagist.org/packages/symbiote/silverstripe-pdfrendition)[ RSS](/packages/symbiote-silverstripe-pdfrendition/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (12)Used By (0)

PDF Rendition Module
====================

[](#pdf-rendition-module)

Maintainer Contact
------------------

[](#maintainer-contact)

- Marcus Nyeholt
- Nathan Glasl

Requirements
------------

[](#requirements)

- SilverStripe 4.12+ || 5+
- Tidy (preferably the built in PHP tidy module, otherwise the commandline binary)
- Java 1.8 (the latest version this has been tested against)
    - **Important:** earlier 1.7 versions cause the PDF to not load *Cloudflare* specific assets such as images and CSS
    - **Important:** regardless of the version you end up using, make sure the PDF output is correct on the production server prior to go-live (please see the known issues section below)

Documentation
-------------

[](#documentation)

This module allows users to easily create complex PDF renditions of content by utilising HTML and CSS3 to define page layouts for printing. It provides a simple extension that adds a simple action for automatically generating PDF renditions of a page, and an API for developers to generate more specific PDF renditions.

Installation Instructions
-------------------------

[](#installation-instructions)

`composer require symbiote/silverstripe-pdfrendition`

Usage Overview
--------------

[](#usage-overview)

- Add `Symbiote\PdfRendition\Extension\PdfControllerExtension` as an extension to PageController
- Add $PdfLink in your template to insert a link to the PDF version of the page
- To customise the PDF layout, create a 'pdfrendition.css' file in your theme directory, link to it with your preferred method (@import, requirements, etc.) and add styles specifically for your pdf using the @print media query. See the github wiki for some examples of how to do some common PDF based things.

Known Issues / Troubleshooting
------------------------------

[](#known-issues--troubleshooting)

- Using HTTPS without a valid certificate can cause the PDF to not render correctly.
- *Cloudflare* can cause the PDF to not render correctly.
    - This may be due to *Java* attempting to reference the assets (images and CSS), and being listed as a "bad browser".
        - To resolve this, *Cloudflare* `Page Rules` need to be added for those specific assets (or a general `/*` blanket rule) with `Browser Integrity Check` set to `Off`.
    - This may also be due to the *Java* version (please see above).
    - The PDF output can be tested by intercepting the render process locally and holding onto the `xhtml` file generated prior to render.
    - Using this, replace the asset URLs with those you want to test and confirm (production for example).
        - The *Java Flying Saucer* utility will retrieve assets and external sources via links contained in the `xhtml` source. Ensure these links are fully formed, and are able to be retrieved from within the production server (i.e. outbound firewall restrictions or localised DNS/host definitions could cause issues).
    - Using this `/tmp/xhtml`, the below should give you a correctly rendered PDF when run from within the production server.
    - If not, *Cloudflare* and/or *Java* are likely the issue.

> java -classpath '**{project}**/pdfrendition/thirdparty/xhtmlrenderer/flying-saucer-core-9.0.7.jar:**{project}**/pdfrendition/thirdparty/xhtmlrenderer/flying-saucer-pdf-9.0.7.jar:**{project}**/pdfrendition/thirdparty/xhtmlrenderer/itext-4.2.1.jar' org.xhtmlrenderer.simple.PDFRenderer '/tmp/xhtml' '/tmp/output.pdf'

- Make sure you don't define @font-face inside @media print.

Occasionally a page won't correctly render, throwing some kind of junk back to the browser as the PDF rendition process fails. Typically, this is caused by malformed XML being sent to the renderer; for this reason everything is first passed through HTML Tidy, however in some rare cases this can still not correctly convert the raw content.

In these cases, errors will be sent through to your error log files; it will indicate the temporary files that were created, so you should first check these for XML errors. If that does not work, you can also attempt to manually perform the conversion using commandline tidy and the commandline for the PDF rendition to see if there are more verbose errors available for debugging the problem.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 88.4% 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 ~257 days

Recently: every ~514 days

Total

9

Last Release

1904d ago

Major Versions

1.2.2 → 2.0.02019-07-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/25cb1c56a7ab949d1e6b28a2a04862ce1cffe1799a291e1797f8dfd33cd83716?d=identicon)[nyeholt](/maintainers/nyeholt)

---

Top Contributors

[![nyeholt](https://avatars.githubusercontent.com/u/161730?v=4)](https://github.com/nyeholt "nyeholt (38 commits)")[![xini](https://avatars.githubusercontent.com/u/1152403?v=4)](https://github.com/xini "xini (4 commits)")[![symkiel](https://avatars.githubusercontent.com/u/57653612?v=4)](https://github.com/symkiel "symkiel (1 commits)")

---

Tags

pdfsilverstripe

### Embed Badge

![Health badge](/badges/symbiote-silverstripe-pdfrendition/health.svg)

```
[![Health](https://phpackages.com/badges/symbiote-silverstripe-pdfrendition/health.svg)](https://phpackages.com/packages/symbiote-silverstripe-pdfrendition)
```

###  Alternatives

[daandesmedt/phpheadlesschrome

A PHP wrapper for using Google Chrome Headless mode. Convert URL or HTML to a PDF / screenshot. Easy to use and OOP interfaced.

92233.1k](/packages/daandesmedt-phpheadlesschrome)[silverstripe/securityreport

Generates a security and access report for CMS users

10292.1k4](/packages/silverstripe-securityreport)[silverstripe/gridfieldqueuedexport

Export large data sets from your GridField in the SilverStripe CMS interface through async jobs

10213.1k5](/packages/silverstripe-gridfieldqueuedexport)[silverstripe/dms

Adds a Document Management System to SilverStripe

4213.8k1](/packages/silverstripe-dms)

PHPackages © 2026

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