oleg-andreyev / wkhtmltopdf-osx
Convert html to pdf using webkit (qtwebkit). Static linked binary for MacOS systems.
Requires (Dev)
- knplabs/knp-snappy: ^1.0
README
This repository contains the static compiled binaries from the wkhtmltopdf project. More about the functionality of wkhtmltopdf and wkthmltoimage can be found there.
Binaries for Linux i386, also installable with composer, can be found here: https://github.com/h4cc/wkhtmltopdf-i386
Binaries for Linux AMD64, also installable with composer, can be found here: https://github.com/h4cc/wkhtmltopdf-amd64
Binaries for Microsoft Windows, also installable with composer, can be found here: github.com/wemersonjanuario/wkhtmltopdf-windows
Binaries for CentOS 7, also installable with composer, can be found here: github.com/rvanlaak/wkhtmltopdf-amd64-centos7
Installation
Hint: The version of the binary is equal to the git tag. To install the latest version, use '0.12.4'.
Packagist
This package can be found on Packagist and installed with Composer.
Require the package for macos with:
php composer.phar require oleg-andreyev/wkhtmltopdf-osx "0.12.5"
The binary will then be located at:
vendor/oleg-andreyev/wkhtmltopdf-osx/bin/wkhtmltopdf-amd64
vendor/oleg-andreyev/wkhtmltopdf-osx/bin/wkhtmltopdf-i386
Also a symlink will be created in your configured bin/ folder, for example:
vendor/bin/wkhtmltopdf-amd64
vendor/bin/wkhtmltopdf-i386
Usage
You can use the path constant to easily locate the binary in the PHP codebase:
$path = \OAndreyev\WKHTMLToPDF\WKHTMLToPDF::PATH_AMD64;
For realpath use following script
$realpath = realpath(\OAndreyev\WKHTMLToPDF\WKHTMLToPDF::PATH_AMD64);