We released the full code and documentation on Github: https://github.com/Api2Pdf/api2pdf.php.
As Api2Pdf gains in popularity due to its low-cost and simple to use API for converting HTML to PDFs, we have started to get requests for libraries and packages in other languages. The most heavily requested is PHP. Therefore, we wrote the PHP code for Api2Pdf which hits all of our endpoints: HTML to PDF, URL to PDF, Office Docs to PDF, and Merge PDFs.
Api2Pdf is a wrapper for wkhtmltopdf, Headless Chrome, and LibreOffice and proudly runs on AWS Lambda to allow for extremely low cost PDF conversions with no rate limits or file size limits.
As an aside, PHP is still a gross language, but I digress.
For those that are looking for some quick and dirty PHP code to use with Api2Pdf, you can see this snippet below which connects to the wkhtmltopdf endpoint, converting HTML to PDF. It uses cURL.
Usage is simple:
For those looking for the full code and sample usage of all methods and endpoints supported by Api2Pdf, please see our Github (https://github.com/Api2Pdf/api2pdf.php) page.
Any and all feedback is welcome.Tags: aws lambda, convert html to pdf php, convert url to pdf php, generate-pdf, headless chrome, headless chrome php, html pdf api, html pdf api php, html to pdf php, html-to-pdf, library, libreoffice php, merge pdfs, merge pdfs php, open source, pdf, php, url to pdf api, wkhtmltopdf, wkhtmltopdf lambda, wkhtmltopdf php
Comments are closed.