Skip to content
Official R&OS PHP Pdf repository
Branch: master
Clone or download
Latest commit db50fad Dec 8, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Fixed issue #113 Dec 8, 2018
extensions Fixed coding standards for extensions and examples Jul 27, 2017
src Fixed issue #113 Dec 8, 2018
tests addText and other fixes (#99) May 24, 2018
.travis.yml addText and other fixes (#99) May 24, 2018
LICENSE added developer notes Oct 22, 2016
composer.json addText and other fixes (#99) May 24, 2018
github.jpg updated readme and examples Oct 26, 2016
phpcs.xml Removed more exceptions not needed anymore Jul 25, 2017
phpunit.xml addText and other fixes (#99) May 24, 2018
readme.php Fixed issue #113 Dec 8, 2018

ROS PHP Pdf creation class

Latest Stable Version Total Downloads Latest Unstable Version License Build Status


This is the offical GIT clone from the R&OS PHP Pdf class previously stored on Development will take place here now.

The R&OS Pdf class is used to generate PDF Documents using PHP without installing any additional modules or extensions It comes with a base class called "Cpdf.php" plus a helper class "Cezpdf.php" to generate tables, add backgrounds and provide paging.


  • Quick and easy to use
  • Support for extension classes
  • Unicode and ANSI formated text
  • Custom TTF fonts and font subsetting (version >= 0.11.8)
  • Auto page and line breaks
  • Text alignments (left, right, center, justified)
  • Linked XObjects
  • Internal and external links
  • Compression by using gzcompress
  • Encryption 40bit, 128bit since PDF 1.4
  • Image support for JPEG, PNG and GIF (partly)
  • Template support


Manual Download

Open the RELEASE page and pick the latest version to download.

Extract the archive into your project directory

Clone via git

You can also use git to install it using:

git clone
git checkout <latest-version>

Installation via composer

This library is also available on the dependecy manager composer -

Please follow the steps here to install. Once this is done one simple command will get all dependencies for the package rospdf/pdf-php

./composer.phar require rospdf/pdf-php

For more details on how to use composer please refer to the documentation -



include 'src/Cezpdf.php'; // Or use 'vendor/autoload.php' when installed through composer

// Initialize a ROS PDF class object using DIN-A4, with background color gray
$pdf = new Cezpdf('a4','portrait','color',array(0.8,0.8,0.8));
// Set pdf Bleedbox
// Use one of the pdf core fonts
$mainFont = 'Times-Roman';
// Select the font
// Define the font size
// Modified to use the local file if it can

// Output some colored text by using text directives and justify it to the right of the document
$pdf->ezText("PDF with some <c:color:1,0,0>blue</c:color> <c:color:0,1,0>red</c:color> and <c:color:0,0,1>green</c:color> colours", $size, array('justification'=>'right'));
// Output the pdf as stream, but uncompress


ole1986 is lead developer.

See the full list of contributors.

You can’t perform that action at this time.