Skip to content

renderpdf-io/renderpdf-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Render HTML to PDF for PHP - RenderPDF.io PHP Library

Unit Test codecov

RenderPDF.io Cover

RenderPDF.io provides awesome & developer-friendly APIs to convert HTML to PDF.

This is a PHP library for RenderPDF.io that provides an easy way to integrate for PHP users.

If you"re a Laravel users, check out this: RenderPDF.io for Laravel

Requirement

  • PHP 8.1 and above

Installation

composer install renderpdf-io/renderpdf-php

Usage

use RenderPdfIoPhp\RenderPdfIoService;
use RenderPdfIoPhp\RenderPdfOptions;

$renderPdfIoService = RenderPdfIoService::make("YOUR_API_KEY_HERE");

$fileUrl = $renderPdfIoService->render(new RenderPdfOptions(
    htmlContent: "Hello world",
    headerHtmlContent: "Welcome to RenderPdf.io - PHP Library",
    footerHtmlContent: "We love you"
));

$isQueued = $renderPdfIoService->renderAsync(new RenderPdfOptions(
    htmlContent: "Render this in async flow please",
));

// if there are any errors, a RenderPdfIoException will be thrown

See all the available options here: RenderPdfOptions.php

Contributing

Thank you for your consideration to contribute to PHP library of RenderPDF.io, please feel free to:

  • Open an issue for bug reports.
  • Submit a PR for improvements/enhancements.

License

This library is free to use, under MIT License.