1 # ROS PHP Pdf creation class
3 [![Latest Stable Version](https://poser.pugx.org/rospdf/pdf-php/v/stable)](https://packagist.org/packages/rospdf/pdf-php) [![Total Downloads](https://poser.pugx.org/rospdf/pdf-php/downloads)](https://packagist.org/packages/rospdf/pdf-php) [![Latest Unstable Version](https://poser.pugx.org/rospdf/pdf-php/v/unstable)](https://packagist.org/packages/rospdf/pdf-php) [![License](https://poser.pugx.org/rospdf/pdf-php/license)](https://packagist.org/packages/rospdf/pdf-php) [![Build Status](https://travis-ci.org/rospdf/pdf-php.svg?branch=master)](https://travis-ci.org/rospdf/pdf-php)
5 ![ros.jpg](https://raw.githubusercontent.com/rospdf/pdf-php/master/ros.jpg "R&OS PHP Pdf creation class")
7 This is the offical GIT clone from the R&OS PHP Pdf class previously stored on [sourceforge.net/projects/pdf-php](https://sourceforge.net/projects/pdf-php/). Development will take place here now.
9 The R&OS Pdf class is used to generate PDF Documents using PHP without installing any additional modules or extensions
10 It comes with a base class called "Cpdf.php" plus a helper class "Cezpdf.php" to generate tables, add backgrounds and provide paging.
12 <div align="center"> <a href="https://github.com/rospdf/pdf-php/blob/master/readme.pdf">DOCUMENTATION</a> : <a href="http://pdf-php.sf.net/">WEBSITE</a></div>
15 - Quick and easy to use
16 - Support for extension classes
17 - Unicode and ANSI formated text
18 - Custom TTF fonts and font subsetting (version >= 0.11.8)
19 - Auto page and line breaks
20 - Text alignments (left, right, center, justified)
22 - Internal and external links
23 - Compression by using gzcompress
24 - Encryption 40bit, 128bit since PDF 1.4
25 - Image support for JPEG, PNG and GIF (partly)
32 Open the [RELEASE](https://github.com/rospdf/pdf-php/releases) page and pick the latest version to download.
34 Extract the archive into your project directory
38 You can also use git to install it using:
40 git clone https://github.com/rospdf/pdf-php.git
41 git checkout <latest-version>
44 ### Installation via composer
46 This library is also available on the dependecy manager `composer` - https://packagist.org/packages/rospdf/pdf-php
48 Please follow the steps [here](https://getcomposer.org/download/) to install. Once this is done one simple command will get all dependencies for the package `rospdf/pdf-php`
50 ./composer.phar require rospdf/pdf-php
52 For more details on how to use `composer` please refer to the documentation - https://getcomposer.org/doc/
59 include 'src/Cezpdf.php'; // Or use 'vendor/autoload.php' when installed through composer
61 // Initialize a ROS PDF class object using DIN-A4, with background color gray
62 $pdf = new Cezpdf('a4','portrait','color',array(0.8,0.8,0.8));
64 $pdf->ezSetMargins(20,20,20,20);
65 // Use one of the pdf core fonts
66 $mainFont = 'Times-Roman';
68 $pdf->selectFont($mainFont);
69 // Define the font size
71 // Modified to use the local file if it can
72 $pdf->openHere('Fit');
74 // Output some colored text by using text directives and justify it to the right of the document
75 $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'));
76 // Output the pdf as stream, but uncompress
77 $pdf->ezStream(array('compress'=>0));
83 [ole1986](http://github.com/ole1986) is lead developer.
85 See the full list of [contributors](https://github.com/rospdf/pdf-php/graphs/contributors).