Created
April 20, 2015 15:00
-
-
Save oldskool/fe923eb2a1555136d1ec to your computer and use it in GitHub Desktop.
WkHtmlToPdf 64-bit binary wrapper for VMs without X install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Script requires xvfb-run command (provided by xorg-x11-server-Xvfb package) | |
| # Require exactly two arguments (input and output file) | |
| if [ $# -ne 2 ]; then | |
| echo "Syntax: $0 <input file> <output file>" | |
| exit 1 | |
| fi | |
| xvfb-run --server-args="-screen 0, 1280x1024x24" /usr/bin/wkhtmltopdf-amd64 --use-xserver $1 $2 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Move the original binary to
/usr/bin/wkhtmltopdf-amd64and save this script as/usr/bin/wkhtmltopdf. Then just the plainwkhtmltopdfcommand will also work on servers/VMs without X install present.