REST service to generate PDF files of given URL(s).
What is inside:
- wkhtmltopdf tool to generate PDF from HTML
- phpwkhtmltopdf PHP class-wrapper for wkhtmltopdf CLI
- Silex PHP mini-framework to build REST API service
- Ansible Vagrant/Server provision scripts
git clone git@github.com:M1r1k/wkhtmltopdf_php_saas.git
cd wkhtmltopdf_php_saas
vagrant up
Add "192.168.150.250 wkhtmltopdf.dev" to /etc/hosts.
Then make POST to generate Google frontpage.
curl -H "Content-Type: application/json" -X POST -d '{"url":"https://www.google.com/"}' http://wkhtmltopdf.dev/rest/pdf/generate > test.pdf
Create Droplet on DO
Change hosts file IP to your new server
sh run.sh
Add "YOUR_DROPLET_IP wkhtmltopdf.prod" to /etc/hosts.
!!!BINGOOOO!!!