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

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

psliwa/php-pdf
==============

Pdf and graphic files generator library for PHP.

1.2.10(9y ago)336520.6k—4.7%77[57 issues](https://github.com/psliwa/PHPPdf/issues)[12 PRs](https://github.com/psliwa/PHPPdf/pulls)3MITPHP

Since Jul 11Pushed 2y ago24 watchersCompare

[ Source](https://github.com/psliwa/PHPPdf)[ Packagist](https://packagist.org/packages/psliwa/php-pdf)[ RSS](/packages/psliwa-php-pdf/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (17)Used By (3)

Information
===========

[](#information)

[![Build Status](https://camo.githubusercontent.com/c0ac40994b19ae68a9c75e3f29389f4c086da5edc0badfd1f539fd699ed51ba4/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f70736c6977612f5048505064662e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/psliwa/PHPPdf)

Examples
========

[](#examples)

Sample documents are in the "examples" directory. "index.php" file is the web interface to browse examples, "cli.php" is a console interface. Via the web interface, the documents are available in pdf and jpeg format (the jpeg format requires Imagick).

Documentation
=============

[](#documentation)

Table of contents
-----------------

[](#table-of-contents)

1. [Introduction](#intro)
2. [Installation](#installation)
3. [Symfony2 bundle](#symfony2-bundle)
4. [FAQ](#faq)
5. [Document parsing and creating pdf file](#parsing)
6. [Basic document structure](#structure)
7. [Inheritance](#inheritance)
8. [Stylesheet structure](#stylesheet)
9. [Palette of colors](#color-palette)
10. [Standard tags](#tags)
11. [Attributes](#attributes)
12. [Complex attributes](#complex-attributes)
13. [Units](#units)
14. [Barcodes](#barcodes)
15. [Charts](#charts)
16. [Hyperlinks](#hyperlinks)
17. [Bookmarks](#bookmarks)
18. [Sticky notes](#notes)
19. [Repetitive headers and footers](#headers)
20. [Watermarks](#watermarks)
21. [Page numbering](#page-numbering)
22. [Using the pdf document as a template](#templates)
23. [Separate page on columns](#columns)
24. [Breaking pages and columns](#page-break)
25. [Metadata](#metadata)
26. [Configuration](#configuration)
27. [Markdown support](#markdown)
28. \[Image generation engine\] (#image-generation)
29. [Known limitations](#limitations)
30. [TODO - plans](#todo)
31. [Technical requirements](#requirements)

Introduction
---------------------------------------------

[](#introduction)

PHPPdf is library that transforms an XML document to a PDF document or graphics files. The XML source document is similar to HTML, but there are lots of differences in names and properties of attributes, properties of tags, and there are a lot of not standard tags, not all tags from html are supported, stylesheet is described in an xml document, not in css.

Assumption of this library is not HTML -&gt; PDF / JPEG / PNG, but XML -&gt; PDF / JPEG / PNG transformation. Some tags and attributes are the same as in HTML in order decrease the learning curve of this library.

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

[](#installation)

PHPPdf is available at packagist.org, so you can use composer to download this library and all dependencies.

*(add to require section in your composer.json file)*

```
    "psliwa/php-pdf": "*"
```

You should choose last stable version (or wildcard of stable version), wildcard char ("\*") is only an example.

If you want to use as features as barcodes or image generation, you should add extra dependencies:

```
    "zendframework/zend-barcode": ">=2.0.0,=2.0.0,=0.2.0,
