Convert web pages and HTML documents to various image formats from the command line using the Pdfcrowd API v2.
$ pip install pdfcrowd
You can learn more about other install options here.
Authentication is needed in order to use the Pdfcrowd API. The credentials used for accessing the API are your Pdfcrowd username and the API key. You can sign up for the Pdfcrowd API here.
html2image -user-name "your_username" -api-key "your_apikey" \ -output-format "png" \ "http://www.example.com" > example.png
html2image -user-name "your_username" -api-key "your_apikey" \ -output-format "png" \ "/path/to/MyLayout.html" > MyLayout.png
echo -n "<html><body><h1>Hello World!</h1></body></html>" | \ html2image -user-name "your_username" -api-key "your_apikey" \ -output-format "png" - > HelloWorld.png
Conversion from HTML to image.
-debug-logto get detailed info about the conversion, such as conversion errors, time, console output.
libPdfcrowd.highlightHtml(borders, backgrounds, labels, noZeroSpace)method call to visualize all HTML elements. See example.