Step 1) Install the PHP client library from github: https://github.com/Api2Pdf/api2pdf.php
Step 2) Grab an API key from https://portal.api2pdf.com. Only takes 60 seconds.
Step 3) Use the sample code below and replace “YOUR-API-KEY” with the api key you acquired in step 2.
require_once 'your-own-directory/Api2Pdf.php'; $apiClient = new Api2Pdf('YOUR-API-KEY'); $result = $apiClient->chromeHtmlToImage('<p>Hello, World</p>'); echo $result->getFile();
And that’s it! Modify the code as you see fit. Hopefully this saves you time and makes converting HTML to images easy and painless for those writing php code.
We have a whole php based client library for our API that does a lot more than just this. Check out the full library capabilities here: https://github.com/Api2Pdf/api2pdf.phpTags: headless chrome php html to image, html to image api, html to image php, html to png api, html to png php, html to png puppeteer, puppeteer php html to image
Comments are closed.