Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jmleroux/pdf-merger

PDF merger for PHP 7
https://github.com/jmleroux/pdf-merger

fpdf pdf-generation tcpdf

Last synced: about 1 month ago
JSON representation

PDF merger for PHP 7

Awesome Lists containing this project

README

        

# PDFMerger for PHP 7

Original written by http://pdfmerger.codeplex.com/team/view

Forked from https://github.com/clegginabox/pdf-merger

## Installation

```composer require jmleroux/pdf-merger```

## Example Usage

```php
addPDF('samplepdfs/one.pdf', '1, 3, 4');
$pdf->addPDF('samplepdfs/two.pdf', '1-2');
$pdf->addPDF('samplepdfs/three.pdf', 'all');

//You can optionally specify a different orientation for each PDF
$pdf->addPDF('samplepdfs/one.pdf', '1, 3, 4', 'L');
$pdf->addPDF('samplepdfs/two.pdf', '1-2', 'P');

$pdf->merge('file', 'samplepdfs/TEST2.pdf', 'P');
```

### PDF libraries

You can use either FPDF, TCPDF or tFPDF as the internal PDF library
by providing the right parameter to the constructor:

```php