Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSlabon committed May 18, 2015
1 parent 0a84d2a commit 33f9616
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,59 @@ FPDI is a collection of PHP classes facilitating developers to read pages from e
If you're using Composer to manage dependencies, you can use

```bash
$ composer require "setasign/fpdi":"1.5.3"
$ composer require "setasign/fpdi":"1.5.4"
```

or you can include the following in your composer.json file:

```json
{
"require": {
"setasign/fpdi": "1.5.3"
"setasign/fpdi": "1.5.4"
}
}
```

Dependencies
------------
## Dependencies

FPDI is an add-on for [FPDF](http://fpdf.org/). Additionally FPDI can be used with [TCPDF](http://www.tcpdf.org/).
To support both its up to you to load the preferred package before the classes of FPDI are loaded. By default FPDI will extend FPDF. If the TCPDF class exists a new FPDF class will be created which will extend TCPDF while FPDI will extend this.
For completion we added a [FPDF repository](https://github.com/Setasign/FPDF) which simply clones the offical releases.

For completion we added a [FPDF repository](https://github.com/Setasign/FPDF) which simply clones the offical releases. You can use this along with FPDI via Composer:
This package comes without any dependency configuration in the composer.json file. It's up to you to load the desired package as described below.

### Evaluate Dependencies Automatically

To load dependencies automatically we prepared kind of metadata packages. To use FPDI with FPDF use [this](https://github.com/Setasign/FPDI-FPDF) package:

```json
{
"require": {
"setasign/fpdi-fpdf": "1.5.4"
}
}
```

For TCPDF use [this](https://github.com/Setasign/FPDI-TCPDF):

```json
{
"require": {
"setasign/fpdi-tcpdf": "1.5.4"
}
}
```

### Manual Dependencies

To support both FPDF and TCPDF its up to you to load the preferred package before the classes of FPDI are loaded. By default FPDI will extend FPDF. If the TCPDF class exists, a new FPDF class will be created which will extend TCPDF while FPDI will extend this.

To use FPDI with FPDF include following in your composer.json file:

```json
{
"require": {
"setasign/fpdf": "1.7",
"setasign/fpdi": "1.5.3"
"setasign/fpdi": "1.5.4"
}
}
```
Expand All @@ -48,7 +75,7 @@ If you are using TCPDF, your have to update your composer.json respectively to:
{
"require": {
"tecnick.com/tcpdf": "6.2.8",
"setasign/fpdi": "1.5.3"
"setasign/fpdi": "1.5.4"
}
}
```
Expand All @@ -59,3 +86,4 @@ Additionally you have to trigger composers autoloader for the TCPDF class before
class_exists('TCPDF', true); // trigger Composers autoloader to load the TCPDF class
$pdf = new FPDI();
```

0 comments on commit 33f9616

Please sign in to comment.