msti/pdf-converter

There is no license information available for the latest version (1.0.0) of this package.

Creates PDFs using different backend converters. Currently supports dompdf and html2pdf

1.0.0 2018-09-14 09:47 UTC

This package is not auto-updated.

Last update: 2024-05-05 10:49:16 UTC


README

This library allows you to use different PDF converter backends for producing pdf files. Currently supports dompdf and html2pdf.

Installation

composer require msti/pdf-converter

Also, at least one of dompdf or html2pdf is required:

composer require dompdf/dompdf

or

composer require spipu/html2pdf

Usage

$vars = [
    'orientation' => 'landscape',
    'papersize' => 'A4',
    'path' => '/tmp',
    'filename' => 'pdf-converter.pdf'
];

$contents = '<strong>hello there</strong>';

$filename = new PDFConverterFactory()->getPDFConverter('html2pdf')->generate($contents, $vars);