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 4d 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 54% 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

2828d 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.2k32.1M102](/packages/spatie-browsershot)[ismaelw/laratex

A package for creating PDFs in Laravel using LaTeX

12730.1k](/packages/ismaelw-laratex)[rockett/weasyprint

A feature-rich Laravel wrapper for the WeasyPrint Document Factory.

28199.7k](/packages/rockett-weasyprint)[padam87/rasterize-bundle

HTML to PDF Symfony bundle. Works with Puppeteer, PhantomJS, and more.

1579.4k](/packages/padam87-rasterize-bundle)[enzim/tika-wrapper

This is a simple PHP Wrapper for Apache Tika (using the tika-app jar)

6021.3k](/packages/enzim-tika-wrapper)[karkowg/php-mupdf

Minimal PDF to image converter using MuPDF

202.8k](/packages/karkowg-php-mupdf)

PHPackages © 2026

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