2017 © Pedro Peláez
 

library pdf-generator

The vianetz PDF library that generates PDF documents.

image

vianetz/pdf-generator

The vianetz PDF library that generates PDF documents.

  • Wednesday, February 7, 2018
  • by vianetz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 390 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 21 % Grown

The README.md

vianetz Pdf Library

This library offers an easy-to-use API for PDF generation and merging.
Internally it uses the DomPDF library for PDF generation and FPDI for merging., (*1)

More information about this PDF API can also be found on my website., (*2)

Usage

Create PDF document from HTML contents

// Create a new pdf instance.
$pdf = \Vianetz\Pdf\Model\PdfFactory::general()->create();

// Create the document. You can return any kind of HTML content here.
$document = new \Vianetz\Pdf\Model\HtmlDocument('<strong>Hello</strong> World!');

// Add our document to the pdf. You can add as many documents as you like
// as they will all be merged into one PDF file.
$pdf->add($document);

// Save the resulting PDF to file test.pdf - That's it :-)
$pdf->saveToFile('test.pdf');

Merge a PDF file and a PDF string into one PDF file

// Load some random PDF contents
$pdfString = file_get_contents('test1.pdf');

// Setup things
$pdfMerge = \Vianetz\Pdf\Model\PdfMerge::create();

// Do the merge.
$pdfMerge->mergePdfString($pdfString, 'background.pdf');
$pdfMerge->mergePdfFile('test2.pdf');

// Save the result PDF to file result.pdf.
file_put_contents($fileName, $pdfMerge->toPdf());

Tips & Tricks

  • The string literal __PDF_TPC__ will be replaced with the total page count

Frequently Asked Questions

Please find the Frequently Asked Questions on my website., (*3)

Support

If you have any issues or suggestions with this extension, please do not hesitate to contact me., (*4)

License

GNU General Public License v3.0
See also LICENSE file., (*5)

This extension uses the DomPDF library. For license information please visit the DomPdf repository.
This extension uses the FPDI library. For license information please visit the FPDI repository., (*6)

This library uses Semantic Versioning - please find more information at semver.org., (*7)

The Versions

07/02 2018

dev-develop

dev-develop https://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary Free GPL-3.0-or-later

The Requires

 

The Development Requires

pdf vianetz

05/01 2018

dev-master

9999999-dev https://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary Free

The Requires

 

The Development Requires

pdf vianetz

05/01 2018

1.1.0

1.1.0.0 https://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

Free

The Requires

 

The Development Requires

pdf vianetz

05/01 2018

dev-release/1.1.0

dev-release/1.1.0 https://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

Free

The Requires

 

The Development Requires

pdf vianetz

13/09 2017

1.0.3

1.0.3.0 http://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary

The Requires

 

The Development Requires

pdf vianetz

13/09 2017

dev-release/1.0.3

dev-release/1.0.3 http://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary

The Requires

 

The Development Requires

pdf vianetz

09/08 2017

1.0.2

1.0.2.0 http://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary

The Requires

 

The Development Requires

pdf vianetz

09/08 2017

dev-release/1.0.2

dev-release/1.0.2 http://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary

The Requires

 

The Development Requires

pdf vianetz

06/06 2017

1.0.1

1.0.1.0 http://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary

The Requires

 

The Development Requires

pdf vianetz

06/06 2017

dev-release/1.0.1

dev-release/1.0.1 http://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary

The Requires

 

The Development Requires

pdf vianetz

06/05 2017

1.0.0

1.0.0.0 http://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary

The Requires

 

pdf vianetz

06/05 2017

dev-release/1.0.0

dev-release/1.0.0 http://www.vianetz.com

The vianetz PDF library that generates PDF documents.

  Sources   Download

proprietary

The Requires

 

pdf vianetz