PHPackages                             iresults/renderer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. iresults/renderer

ActiveLibrary

iresults/renderer
=================

Library for document creation

0.3.1(1y ago)079MITPHPPHP ^7.2 || ^8.0

Since Jun 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/iresults/renderer)[ Packagist](https://packagist.org/packages/iresults/renderer)[ RSS](/packages/iresults-renderer/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

PDF
===

[](#pdf)

Using the HTML engine
---------------------

[](#using-the-html-engine)

Add mpdf to the Composer JSON file

```
{
    "require": {
        "mpdf/mpdf": "^8.0"
    }
}
```

```
// Create the HTML Renderer instance
$pdfRenderer = \Iresults\Renderer\Pdf\Engine\Html\HtmlFactory::renderer();

$factory = new \Iresults\Renderer\Pdf\Wrapper\MpdfWrapperFactory();
// Set a different context object [optional]
$context = $factory->build([
    'mode'              => '',
    'format'            => 'A4',
    'default_font_size' => 10,
    'default_font'      => '',
    'margin_left'       => 0,
    'margin_right'      => 0,
    'margin_top'        => 40,
    'margin_bottom'     => 20,
    'margin_header'     => 0,
    'margin_footer'     => 0,
])
$pdfRenderer->setContext($context);

// Configuration: Additional fonts [optional]
$context->addFontDirectoryPath('/Path/To/Fonts/Directory');
$context->registerFont(
    'myriad',
    array(
        'R'  => 'MyriadPro-Regular.ttf',
        'I'  => 'MyriadPro-It.ttf',
        // Alternative bold styles:
        // 'B' => 'MyriadPro-Bold.ttf',
        // 'BI' => 'MyriadPro-BoldIt.ttf',
        'B'  => 'MyriadPro-Semibold.ttf',
        'BI' => 'MyriadPro-SemiboldIt.ttf',
    )
);

// Configuration: Define the header [optional]
$context->SetHTMLHeader('Header');

// Configuration: Define  the footer [optional]
$context->SetHTMLFooter(''.date('d.m.Y').'');
// or
$context->DefHTMLFooterByName('Footer', ''.date('d.m.Y').'');

// Set the template/content to render
$pdfRenderer->setTemplate($body);

// Define a path to save the PDF file at
$pdfRenderer->setSavePath($savePath);

// Add a stylesheet
$pdfRenderer->setStylesPath($styleSheet);

$pdfRenderer->render();

// Send the PDF to the browser
$pdfRenderer->output();
// or save it to the disk
$pdfRenderer->save();
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance49

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~957 days

Total

4

Last Release

372d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/da109c98da5adda4f3818c747dbba428d1e80c06ece9e51aabd716ba76024ef4?d=identicon)[cundd](/maintainers/cundd)

---

Top Contributors

[![cundd](https://avatars.githubusercontent.com/u/743122?v=4)](https://github.com/cundd "cundd (45 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/iresults-renderer/health.svg)

```
[![Health](https://phpackages.com/badges/iresults-renderer/health.svg)](https://phpackages.com/packages/iresults-renderer)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
