You can easily generate PDFs from HTML files using
You can find clear documentation for this project in it's README.
This library makes use of
wkhtmltopdf. This is an external tool and will need to be installed on your server
for this library to work.
wkhtmltopdf from your package manager. This will be missing a number of features
and will require a graphical environment to be installed / running on your server.
- First you need to grab the latest version of
wkhtmltopdffor your server from here.
- Next you need to install the package. To install the package use your servers normal package management tool
dpkgas they'll resolve and install any dependencies for you.
yum install wkhtmltox-*.centos7.x86_64.rpm
To stitch PDFs together you can make use of Ghostscript.
This is another external tool and will need to be installed on your server.
This one's nice and simple as you can just use your distro's package manager.
yum install ghostscript
You can use the following command to stitch together a number of PDFs
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=all_parts.pdf part1.pdf part2.pdf part3.pdf
This can easily be wrapped in a
PHP class using
exec to create a PDF stitcher for your project.