PHPackages                             lennon-mudenda/wkhtml2pdf - 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. lennon-mudenda/wkhtml2pdf

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

lennon-mudenda/wkhtml2pdf
=========================

Html 2 Pdf - using wkhtml2pdf, work on 32bit and 64 bit linux + MacOS

08PHP

Since Jun 10Pushed 1y agoCompare

[ Source](https://github.com/lennon-mudenda/wkhtml2pdf)[ Packagist](https://packagist.org/packages/lennon-mudenda/wkhtml2pdf)[ RSS](/packages/lennon-mudenda-wkhtml2pdf/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

wkhtml2pdf
==========

[](#wkhtml2pdf)

[![Latest Build Status](https://camo.githubusercontent.com/6a5b651be01bbf4d857b6368029bec93cbd16c1d824ac35e4432466a90bb9f84/68747470733a2f2f7472617669732d63692e6f72672f4e69744d656469612f776b68746d6c327064662e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/6a5b651be01bbf4d857b6368029bec93cbd16c1d824ac35e4432466a90bb9f84/68747470733a2f2f7472617669732d63692e6f72672f4e69744d656469612f776b68746d6c327064662e7376673f6272616e63683d6d6173746572)

Version 1.0 - Html to PDF Composer Package

\#Usage#

```
return PDF::html('hello'); // hello is naw of blade template

return PDF::html('hello',array('name' => 'Nithin')); // pass variables for the view as second option

return PDF::html('hello',array('name' => 'Nithin'), 'New File'); // thrid option is for the name of the pdf file thats generated

PDF::url('http://google.com'); // Pdf from url

// What to download to a file instead ?

PDF::setOutputMode('F'); // force to file
PDF::html('app.invoices.pdf',['title'=>$title],'/var/www/test.pdf'); // custom download path

```

Laravel Quick start
-------------------

[](#laravel-quick-start)

### Required setup

[](#required-setup)

In the `require` key of `composer.json` file add the following

```
"nitmedia/wkhtml2pdf": "dev-master"

```

Run the Composer update comand

```
$ composer update nitmedia/wkhtml2pdf

```

#### L5

[](#l5)

In your `config/app.php` add `'Nitmedia\Wkhtml2pdf\L5Wkhtml2pdfServiceProvider'` to the end of the `$providers` array

```
'providers' => array(
    ...
    Nitmedia\Wkhtml2pdf\L5Wkhtml2pdfServiceProvider::class,
),

```

#### L4

[](#l4)

In your `config/app.php` add `'Nitmedia\Wkhtml2pdf\Wkhtml2pdfServiceProvider'` to the end of the `$providers` array

```
'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'Nitmedia\Wkhtml2pdf\Wkhtml2pdfServiceProvider',

),

```

At the end of `config/app.php` add `'PDF'    => 'Nitmedia\Wkhtml2pdf\Facades\Wkhtml2pdf'` to the `$aliases` array

```
'aliases' => array(

    'App'        => Illuminate\Support\Facades\App::class,
    'Artisan'    => Illuminate\Support\Facades\Artisan::class,
    ...
    'PDF'    => Nitmedia\Wkhtml2pdf\Facades\Wkhtml2pdf::class,

),

```

Configuration
-------------

[](#configuration)

Please set the driver file accoridng to the current OS, Supported drivers include: mac osx, linux 32, linux 64

```
php artisan vendor:publish

```

### Driver

[](#driver)

[wkhtml2pdf](http://wkhtmltopdf.org/)

Version: [0.12.1-rc](https://github.com/wkhtmltopdf/wkhtmltopdf/tree/c22928d)

### Driver types

[](#driver-types)

- wkhtmltopdf-0.12.1-OS-X.i386 - `Mac OS X 10.8+ (Carbon), 32-bit`
- wkhtmltopdf-amd64 - `Linux (Debian Wheezy), 64-bit, for recent distributions (i.e. glibc 2.13 or later)`
- wkhtmltopdf-i386 - `Linux (Debian Wheezy), 32-bit, for recent distributions (i.e. glibc 2.13 or later)`

Troubleshooting
---------------

[](#troubleshooting)

```
**There is a debug flag in config where you can test the output of the drivers.**

1. Some users have noted a strange permissions issue executing the drivers. Try chmod'ing the driver files to solve the issue.
2. All asset urls must be absolute, relative urls wont work.
3. ***Ubuntu users*** you need to do => apt-get install libxrender1 libxext6

```

The MIT License (MIT)

Copyright (c) &lt;2013&gt;

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.2% 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.

### Community

Maintainers

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

---

Top Contributors

[![chonthu](https://avatars.githubusercontent.com/u/339132?v=4)](https://github.com/chonthu "chonthu (43 commits)")[![izzyp](https://avatars.githubusercontent.com/u/1904199?v=4)](https://github.com/izzyp "izzyp (6 commits)")[![MyMediaMagnet](https://avatars.githubusercontent.com/u/957497?v=4)](https://github.com/MyMediaMagnet "MyMediaMagnet (4 commits)")[![lennon-mudenda](https://avatars.githubusercontent.com/u/19418575?v=4)](https://github.com/lennon-mudenda "lennon-mudenda (3 commits)")[![laszlokis-lynx](https://avatars.githubusercontent.com/u/258006090?v=4)](https://github.com/laszlokis-lynx "laszlokis-lynx (2 commits)")[![sdebacker](https://avatars.githubusercontent.com/u/134503?v=4)](https://github.com/sdebacker "sdebacker (1 commits)")[![bretto36](https://avatars.githubusercontent.com/u/6217994?v=4)](https://github.com/bretto36 "bretto36 (1 commits)")[![ylecuyer](https://avatars.githubusercontent.com/u/1866809?v=4)](https://github.com/ylecuyer "ylecuyer (1 commits)")[![felixcheruiyot](https://avatars.githubusercontent.com/u/1054590?v=4)](https://github.com/felixcheruiyot "felixcheruiyot (1 commits)")[![JValck](https://avatars.githubusercontent.com/u/12137899?v=4)](https://github.com/JValck "JValck (1 commits)")[![lucasvdh](https://avatars.githubusercontent.com/u/4311594?v=4)](https://github.com/lucasvdh "lucasvdh (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")

### Embed Badge

![Health badge](/badges/lennon-mudenda-wkhtml2pdf/health.svg)

```
[![Health](https://phpackages.com/badges/lennon-mudenda-wkhtml2pdf/health.svg)](https://phpackages.com/packages/lennon-mudenda-wkhtml2pdf)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

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