PHPackages                             dpsoft/php-html-to-pdf - 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. dpsoft/php-html-to-pdf

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

dpsoft/php-html-to-pdf
======================

Convert any url or html to pdf/image using google-chrome or chromium-browser

v1.1(7y ago)6101MITPHPPHP ^7.0

Since Aug 16Pushed 7y ago2 watchersCompare

[ Source](https://github.com/dpsoft-official/phpHtmlToPdf)[ Packagist](https://packagist.org/packages/dpsoft/php-html-to-pdf)[ RSS](/packages/dpsoft-php-html-to-pdf/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Url to Pdf/image export in Php
==============================

[](#url-to-pdfimage-export-in-php)

[![License: GPL v2](https://camo.githubusercontent.com/77e900ae34f8da9ccccc42662fce61a94ab07ddbfe3f7d066178e824f3673dbd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c25323076322d626c75652e737667)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)

Convert any url or html to pdf/image using google-chrome or chromium-browser

Installation
------------

[](#installation)

```
$ composer require dpsoft/php-html-to-pdf
```

Requirement
-----------

[](#requirement)

This package uses google-chrome/chromium-browser. for example install chromium-browser on linux ubuntu:

```
~ sudo apt install chromium-browser
```

To verify requirement, run following test from package folder:

```
~ composer test
```

Implementation
--------------

[](#implementation)

Use url or html file to export:

```
require "vendor/autoload.php";

use Dpsoft\HtmlToPdf\Converter;

$converter = new Converter();

// export to pdf
$convertor->setUrl('http://google.com')->toPdf('pdf/file/name.pdf');

// or export to png
$convertor->setUrl('http://google.com')->toPng('png/file/name.png');

// you can set window size for png export
$convertor->setUrl('http://google.com')->setWindow(1280,960)->toPng('png/file/name.png');
```

Test
----

[](#test)

Run test:

```
~ composer test
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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 ~1 days

Total

2

Last Release

2873d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8ce9db5e47c9f42b80ea1102230d26603ed743596b579011934e7b67b37811d?d=identicon)[dpsoft-ir](/maintainers/dpsoft-ir)

---

Top Contributors

[![SadeghPM](https://avatars.githubusercontent.com/u/9298600?v=4)](https://github.com/SadeghPM "SadeghPM (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dpsoft-php-html-to-pdf/health.svg)

```
[![Health](https://phpackages.com/badges/dpsoft-php-html-to-pdf/health.svg)](https://phpackages.com/packages/dpsoft-php-html-to-pdf)
```

###  Alternatives

[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k35.1M142](/packages/spatie-browsershot)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[pontedilana/php-weasyprint

PHP library allowing PDF generation from an url or a html page. Wrapper for Kozea/WeasyPrint.

781.2M14](/packages/pontedilana-php-weasyprint)[mostafaznv/pdf-optimizer

PDF optimization tool for PHP and Laravel applications

171153.2k](/packages/mostafaznv-pdf-optimizer)[ismaelw/laratex

A package for creating PDFs in Laravel using LaTeX

13033.1k](/packages/ismaelw-laratex)

PHPackages © 2026

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