Transform XML Documents to PDF via PHP Library

Open Source PHP API to Generate, Edit, and Process PDF Documents, Add Barcode, Charts, Tables, Headers & Footers, and Bookmarks to PDF Files.

PHPPdf library has provided the capability to transform your XML documents to a PDF document or graphics files inside your own application without any external dependencies. Using the PHP PDF Library programmers can easily create custom PDF apps supporting a set of extraordinary features with few lines of PHP code.

PHPPdf help developers to build their own powerful PDF converter in minimum cost and effort. Several important features related to PDF creation and manipulation is fully supported by the library such as generate PDF files from the scratch, Barcode support in PDFs, drawing simple charts, external and internal hyperlinks support, bookmarks creation support, adding sticky notes, headers and footers support, adding watermark, breaking pages & columns, metadata and many more.

The PHPPdf library has also included support for defining style-sheets. You can easily define your style-sheets in an external file and can include short as well as long declarations of attributes. It also supports color palettes that give users the ability to create or overwrite default named colors.


Previous Next

Getting Started with PHPPdf

PHPPdf is available at, so you can use the composer to download this library and all dependencies. Please use the following command for a smooth installation.

Install PHPPdf via composer

$ composer require psliwa/php-pdf

PDF Files Creation from XML via PHP API

PHPPdf library allows software developers to create PDF documents by transforming an XML document inside their own PHP applications. The library supports UTF-8 encoding and has provided some free fonts for this purpose. You can easily set page size using standard predefined values like legal, letter, A4, etc. as well can set custom page dimensions. You can also define font type, size, and styles like normal, bold, italic, bold-italic, light, or light-italic with ease.

Add Headers & Footers to PDF File

The headers and footers are the top and bottom sections of a PDF that gives a professional look to PDF documents. To make longer PDF documents organized and easier to read developers can use Headers and footers section of a PDF document. The PHPPdf supports adding headers & footers to PDF documents. It supports features like adding repetitive header/footer, insert images in a header/footer, add page numbers, and much more.

Barcode Supports in PDF Files via PHP

The PHPPdf library supports adding Barcodes to PDF documents using simple PHP commands. The library uses the Zend\Barcode library in order to generate barcode. You can use different Barcode types like code128, code25, code25interleaved, code39, ean13, ean2, ean5, ean8, identcode, itf14, and many more. You can easily set Barcode height, thin-width, checksum, thick-width & more.

Extract Metadata from PDF Document

PHPPdf library gives software developers the power to read & extract metadata from a PDF document via PHP. Metadata includes important information about the PDF document. The library supports metadata like Creator, Keywords, Subject, Author, Title, ModDate, CreationDate, and Trapped.