https://github.com/rospdf/pdf-php
Official R&OS PHP Pdf repository
https://github.com/rospdf/pdf-php
native pdf-php php ros
Last synced: 11 months ago
JSON representation
Official R&OS PHP Pdf repository
- Host: GitHub
- URL: https://github.com/rospdf/pdf-php
- Owner: rospdf
- License: other
- Created: 2016-05-10T09:44:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-01-25T07:19:42.000Z (about 2 years ago)
- Last Synced: 2025-05-02T23:03:05.097Z (11 months ago)
- Topics: native, pdf-php, php, ros
- Language: PHP
- Homepage: http://pdf-php.sourceforge.net/
- Size: 5.54 MB
- Stars: 144
- Watchers: 20
- Forks: 65
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# ROS PHP Pdf creation class
[](https://packagist.org/packages/rospdf/pdf-php)
[](https://packagist.org/packages/rospdf/pdf-php)
[](https://packagist.org/packages/rospdf/pdf-php)
[](https://packagist.org/packages/rospdf/pdf-php)
[](https://github.com/rospdf/pdf-php/actions/workflows/ci-build.yml)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CCU8QYD549JCU&source=url)

This is the official 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.
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 formatted 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](https://github.com/rospdf/pdf-php/releases) 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
### Installation via composer
This library is also available on the dependency manager `composer` - https://packagist.org/packages/rospdf/pdf-php
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`
./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
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 blue red and green colours", $size, ['justification'=>'right']);
// Output the pdf as stream, but uncompress
$pdf->ezStream(['compress'=>0]);
?>
```
## Contributors
[ole1986](http://github.com/ole1986) is lead developer.
See the full list of [contributors](https://github.com/rospdf/pdf-php/graphs/contributors).