This page contains various examples of using the HTML to Image API in Command Line. The examples are complete and fully functional. Read more about how to convert HTML to Image in Command Line.
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"
echo -n "Hello {{ name }} from {{ product }}" | \ html2image -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \ -output-format "png" \ -data-string "$(echo -e "{ \"name\": \"World\", \"product\": \"Pdfcrowd API\" }")" - > "output.pdf"
echo -n "Hello {{ data.name }} from {{ data.product }}" | \ html2image -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \ -output-format "png" \ -data-string "$(echo -e "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <data> <name>World</name> <product>Pdfcrowd API</product> </data>")" - > "output.pdf"
echo -n "Hello {{ name }} from {{ product }}" | \ html2image -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \ -output-format "png" \ -data-string "$(echo -e "name: World product: Pdfcrowd API")" - > "output.pdf"
echo -n "Hello {{ name }} from {{ product }}" | \ html2image -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \ -output-format "png" \ -data-string "$(echo -e "name,product World,Pdfcrowd API")" - > "output.pdf"