This page describes how to convert web pages and HTML to images from the command line using the cloud-based Pdfcrowd API. You can find general information about the converter on the HTML to Image API page.
pip install pdfcrowd
We also offer other installation options.
The credentials to access the API are your Pdfcrowd username and the API key. You can try out the API without registering using the following demo credentials:
You can enter a web page or upload an HTML file to get an image output preview in our API playground. The playground allows you to interactively play with the API settings and autogenerates corresponding Command Line code that you can copy and paste to your application.
Or you can choose from the examples below and adapt the code to your needs.
Refer to the HTML to Image Command Line Reference Manual for a description of all command line options.
Here are a few Command Line examples to get you started quickly with the API. See more examples.
html2image -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \ -output-format "png" \ "http://www.example.com" > "example.png"
html2image -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \ -output-format "png" \ "/path/to/MyLayout.html" > "MyLayout.png"
echo -n "<html><body><h1>Hello World!</h1></body></html>" | \ html2image -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \ -output-format "png" - > "HelloWorld.png"
The API can be easily integrated into your environment. You can have our interactive API Playground autogenerate the integration code for you:
-debug-logto get detailed info about the conversion, such as load errors, load times, browser console output, etc.