Skip to content

Wkhtmltopdf, Silex Framework, Ansible provision for Digital Ocean

License

Notifications You must be signed in to change notification settings

M1r1k/wkhtmltopdf_php_saas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WKHtmlToPDF as Service via PHP REST API built with Silex framework

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

Local development

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

Deploying to server (Digital Ocean example)

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!!!

About

Wkhtmltopdf, Silex Framework, Ansible provision for Digital Ocean

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages