eprofos/php-wkhtmltopdf

A PHP library for converting HTML to PDF using wkhtmltopdf with extensive customization options.

v0.2.0 2024-11-13 22:00 UTC

This package is auto-updated.

Last update: 2025-04-13 22:53:18 UTC


README

PHP Version Stable Version Build Status License Total Downloads

A PHP library for converting HTML to PDF using the wkhtmltopdf command-line tool with extensive customization options.

Requirements

  • PHP 7.4+
  • wkhtmltopdf binary installed on your system

Installation

You can install the package via composer:

composer require eprofos/php-wkhtmltopdf

Caution

This package requires the wkhtmltopdf binary to be installed on your system. You can download it from the official website for your respective operating system.

Usage

Here's a basic example of how to use the library:

use Eprofos\PhpWkhtmltopdf\WKHtmlToPdf;

$wkhtmltopdf = new WKHtmlToPdf('/path/to/wkhtmltopdf');

$wkhtmltopdf->addPage('https://example.com')
             ->setPageSize('A4')
             ->setOrientation('Portrait')
             ->setGrayscale(true)
             ->setZoom(0.75)
             ->generate('output.pdf');

Documentation

For detailed documentation on all features and options, please refer to the documentation.

License

This library is licensed under the MIT License. See the LICENSE file for more details.

Contributing

Contributions are welcome! Please submit pull requests or open issues to help improve this library.

Contact

If you experience bugs or want to request new features, please visit the issue tracker.