PHPackages                             wenfei-huang/wkhtmltox - 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. wenfei-huang/wkhtmltox

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

wenfei-huang/wkhtmltox
======================

wkhtmltopdf and wkhtmltoimage Linux Ubuntu 20.04 focal amd64 binaries

0.12.6(4y ago)0154LGPL-3.0-onlyPHP

Since Jan 13Pushed 4y agoCompare

[ Source](https://github.com/wenfei-huang/wkhtmltox)[ Packagist](https://packagist.org/packages/wenfei-huang/wkhtmltox)[ Docs](http://wkhtmltopdf.org/)[ RSS](/packages/wenfei-huang-wkhtmltox/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

wkhtmltox
=========

[](#wkhtmltox)

This repository contains the version 0.12.6 of wkhtmltopdf and wkhtmltoimage from the [wkhtmltopdf project](https://github.com/wkhtmltopdf/wkhtmltopdf), check for latest ().

The binaries are built for Ubuntu 20.04 focal, amd64 only AMD64 architectures are included.

Why
---

[](#why)

h4cc/wkhtmltopdf-amd64 and h4cc/wkhtmltoimage-amd64 package is outdated and gives errors on php 8.0

When it's not possible to install the latest version via .deb package with apt

```
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
```

Or sometimes you just want a quick solution for your dev environment ;)

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

[](#installation)

This package is published on [Packagist](https://packagist.org/packages/wenfei-huang/wkhtmltox) and should be installed with [Composer](https://getcomposer.org/download/).

The version of the binary is equal to the git tag. Composer will install the latest version by default.

```
$ composer require-dev wenfei-huang/wkhtmltox
```

Composer will install the package in your project path into the *vendor/wenfei-huang/wkhtmltox/* directory.

The binaries are located in the *vendor/wenfei-huang/wkhtmltox/bin/* directory.

Composer will symlink them to the *vendor/bin/* directory.

*Optional:* You can also symlink them to the */usr/local/bin/* directory, as apt would install normally there.

```
$ ln -s /absolute/path/to/your/project/vendor/wenfei-huang/wkhtmltox/bin/wkhtmltopdf_0.12.6_linux_ubuntu_focal_amd64 /usr/local/bin/wkhtmltopdf
$ ln -s /absolute/path/to/your/project/vendor/wenfei-huang/wkhtmltox/bin/wkhtmltoimage_0.12.6_linux_ubuntu_focal_amd64 /usr/local/bin/wkhtmltoimage
```

Check the Version:

```
$ wkhtmltopdf -V
wkhtmltopdf 0.12.6 (with patched qt)
```

### Usage

[](#usage)

If using with [Laravel Snappy PDF](https://github.com/barryvdh/laravel-snappy) package, you can change in the snappy config file:

```
    'pdf' => array(
        ...
        'binary'  => base_path('vendor/wenfei-huang/wkhtmltox/bin/wkhtmltopdf-amd64'),
        ...

    ),
    'image' => array(
        ...
        'binary'  => base_path('vendor/wenfei-huang/wkhtmltox/bin/wkhtmltoimage_0.12.6_linux_ubuntu_focal_amd64'),
        ...
    ),
```

With the [KNP-Snappy](https://github.com/KnpLabs/snappy) package, you can now use the binaries to create PDFs or Images from HTML.

You can use the path constants from this project to easily locate the binary paths (with PSR 4 Autoloader):

```
