PHP

RenderPDF.io PHP Library

We ship a PHP library that provides easy integration with RenderPDF.io

GitHub: https://github.com/renderpdf-io/renderpdf-php

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

Last updated