armonia-tech/armonia-pdf

Wrapper for 3rd party pdf renderer

dev-master 2024-10-16 08:31 UTC

This package is auto-updated.

Last update: 2024-11-16 08:40:41 UTC


README

A library to convert html to pdf

Add to Project

In your project's directory run in cli:

composer require armonia-tech/armonia-pdf:dev-master

Development

Go up 1 level from your project's directory, run in cli:

git clone https://github.com/armonia-tech/armonia-pdf.git

In your project's composer.json, add the following:

"repositories": [
    {
        "type": "path",
        "url":  "../armonia-pdf"
    }
]

then run in cli:

composer require armonia-tech/armonia-pdf:dev-master

Usage

Basic:

use ArmoniaPDF\PDF;

$dompdf = new PDF;

$dompdf->setPaper('A4', 'portrait');
$dompdf->loadHtml('<div>Hello</div>');
$dompdf->stream('download.pdf');

Methods:

Reference:

  1. Dompdf\Dompdf