PrintCSS Render Library

The Bit&Black PrintCSS Renderer library provides a consistent API to handle all existing PrintCSS renderers in the same way.


This library was written in PHP and requires a token before it can be installed. The use of the library is subject to a fee.

Once you received a token you can add the library to your project by running $ composer require bitandblack/printcss-renderer.


Initialize the Renderer with an instance of the renderer you want to use:


use BitAndBlack\PrintCSS\Renderer\Renderer;
use BitAndBlack\PrintCSS\Renderer\Renderer\PDFreactor;

$pdfReactor = new PDFreactor('my-license');
$renderer = new Renderer($pdfReactor);

Configure the renderer with the needed settings:


use BitAndBlack\ICCProfile\File;
use BitAndBlack\ICCProfile\FileEnum;
use BitAndBlack\ICCProfile\ICCProfile;
use BitAndBlack\PrintCSS\Renderer\Enum\OutputIntentEnum;

    ->setICCProfile(new ICCProfile(
        new File(FileEnum::PROFILE_PSOcoated_v3())

Use the convert method then to get PDF files from HTML:


$document = (string) file_get_contents('my-input-file.html');

$response = $renderer->convert($document);