PHPackages                             kiklop74/moodle-local\_dompdf - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. kiklop74/moodle-local\_dompdf

ActiveMoodle-local[PDF &amp; Document Generation](/categories/documents)

kiklop74/moodle-local\_dompdf
=============================

DomPDF library for Moodle

v1.5(1y ago)111GPL-3.0-or-laterPHPPHP ^7.2||^8.0

Since Jun 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kiklop74/moodle-local_dompdf)[ Packagist](https://packagist.org/packages/kiklop74/moodle-local_dompdf)[ RSS](/packages/kiklop74-moodle-local-dompdf/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (0)

Dompdf
======

[](#dompdf)

**Dompdf is an HTML to PDF converter**

At its heart, dompdf is (mostly) a [CSS 2.1](http://www.w3.org/TR/CSS2/) compliant HTML layout and rendering engine written in PHP. It is a style-driven renderer: it will download and read external stylesheets, inline style tags, and the style attributes of individual HTML elements. It also supports most presentational HTML attributes.

Requirements
------------

[](#requirements)

- PHP 7.1+
- Moodle 3.5+
- MBString extension

### Recommendations

[](#recommendations)

- OPcache (OPcache, XCache, APC, etc.): improves performance
- IMagick or GMagick extension: improves image processing performance

Visit the wiki for more information:

### Internal settings

[](#internal-settings)

By default whenever a PDF is generated systems uses `$CFG->localcachedir/dompdf` to store temporary data.

### Usage

[](#usage)

To create new instance of the PDF class use following code:

```
$pdf = \local_dompdf\api\pdf::createnew();

```

This gives you an instance of `\Dompdf\Dompdf` class and you just use it as outlined in the official [library documentation](https://github.com/dompdf/dompdf/wiki).

#### Images stored in Moodle HTML editor.

[](#images-stored-in-moodle-html-editor)

In case you want to convert to PDF HTML that does contain images coming from Moodle internal file systems you need to employ the image recoding for each specific field.

For example if you have a place where you can set the image in HTML editor when you retrieve it from database to display it on screen you use this code:

```
$rawtext = $DB->get_field('sometable', 'somefield', ['id' => 123]);
$options = [
    'noclean' => true, 'para' => false, 'filter' => true,
    'context' => $context, 'overflowdiv' => true
];
$intro = file_rewrite_pluginfile_urls(
    $rawtext, 'pluginfile.php', $context->id, $component, $filearea, $itemid
);
$value = format_text($intro, $format, $options, null);

```

For Dmpdf this does not work. There is a specific rewrite method that encode's images directly into html and makes them usable by library:

```
$rawtext = $DB->get_field('sometable', 'somefield', ['id' => 123]);
$options = [
    'noclean' => true, 'para' => false, 'filter' => true,
    'context' => $context, 'overflowdiv' => true
];
$intro = \local_dompdf\api\pdf::file_rewrite_image_urls(
    $rawtext, $itemid, $filearea, $contextid, $component
);
$value = format_text($intro, $format, $options, null);

```

### Examples

[](#examples)

Examples are located in examples directory of the plugin.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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 ~371 days

Recently: every ~278 days

Total

6

Last Release

717d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/216822?v=4)[Darko Miletic](/maintainers/kiklop74)[@kiklop74](https://github.com/kiklop74)

---

Top Contributors

[![kiklop74](https://avatars.githubusercontent.com/u/216822?v=4)](https://github.com/kiklop74 "kiklop74 (72 commits)")[![lukascelinak](https://avatars.githubusercontent.com/u/58947427?v=4)](https://github.com/lukascelinak "lukascelinak (1 commits)")

---

Tags

moodlemoodle-localmoodle-pluginphp

### Embed Badge

![Health badge](/badges/kiklop74-moodle-local-dompdf/health.svg)

```
[![Health](https://phpackages.com/badges/kiklop74-moodle-local-dompdf/health.svg)](https://phpackages.com/packages/kiklop74-moodle-local-dompdf)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[october/rain

October Rain Library

1601.7M83](/packages/october-rain)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k16.4k79](/packages/elgg-elgg)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[rainlab/user-plugin

User plugin for October CMS

11955.0k15](/packages/rainlab-user-plugin)

PHPackages © 2026

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