Menu

Tree [7a9342] master 0.12.51 /
 History

HTTPS access


File Date Author Commit
 .vscode 2017-05-20 ole1986 ole1986 [3311c2] updated readme and fixed tasks.json for mac/linux
 examples 2019-04-16 ole1986 ole1986 [0ac7c8] Possible fix for issue #114 , #115 and #117
 extensions 2019-04-16 ole1986 ole1986 [c29f50] Resolved deprecated method 'each()' in CezTable...
 src 2019-04-16 ole1986 ole1986 [0f22f3] PSR
 tests 2018-05-24 ole ole [2fe8ab] addText and other fixes (#99)
 .gitignore 2018-12-08 ole1986 ole1986 [db50fa] Fixed issue #113
 .travis.yml 2018-05-24 ole ole [2fe8ab] addText and other fixes (#99)
 DEVELOPER.md 2016-10-22 ole ole [e85cbd] added developer notes
 LICENSE 2017-05-27 ole ole [cb2a23] Release project under the term of the MIT license
 README.md 2016-10-22 ole ole [e85cbd] added developer notes
 composer.json 2018-05-24 ole ole [2fe8ab] addText and other fixes (#99)
 composer.lock 2018-05-24 ole ole [2fe8ab] addText and other fixes (#99)
 data.txt 2019-04-16 ole1986 ole1986 [7a9342] Version 0.12.51 (PSR only)
 github.jpg 2016-10-26 ole ole [18ea98] updated readme and examples
 phpcs.xml 2017-07-25 Lars Olesen Lars Olesen [a529bc] Removed more exceptions not needed anymore
 phpunit.xml 2018-05-24 ole ole [2fe8ab] addText and other fixes (#99)
 readme.pdf 2019-04-16 ole1986 ole1986 [7a9342] Version 0.12.51 (PSR only)
 readme.php 2019-04-16 ole1986 ole1986 [7a9342] Version 0.12.51 (PSR only)
 ros.jpg 2010-03-06 Lars Olesen Lars Olesen [0aa1f9] Moved files to trunk.

Read Me

ROS PHP Pdf creation class

Latest Stable Version Total Downloads Latest Unstable Version License Build Status

ros.jpg

This is the offical GIT clone from the R&OS PHP Pdf class previously stored on sourceforge.net/projects/pdf-php. 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.

Features

  • 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

Installation

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 https://github.com/rospdf/pdf-php.git
git checkout <latest-version>

Installation via composer

This library is also available on the dependecy manager composer - https://packagist.org/packages/rospdf/pdf-php

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 - https://getcomposer.org/doc/

Example

<?php

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
$pdf->ezSetMargins(20,20,20,20);
// Use one of the pdf core fonts
$mainFont = 'Times-Roman';
// Select the font
$pdf->selectFont($mainFont);
// Define the font size
$size=12;
// Modified to use the local file if it can
$pdf->openHere('Fit');

// 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
$pdf->ezStream(array('compress'=>0));
?>

Contributors

ole1986 is lead developer.

See the full list of contributors.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.