HTML To Image and PDF
Render and convert raw HTML, CSS styles, web layouts, and components into high-resolution images (WebP, PNG, JPG) or vector PDF documents with customizable viewport dimensions.
Parameters
Configure parameters and run inference.
Ready for Execution
Configure parameters on the left and click Run Microservice to generate output.
Rendering HTML Layout...
Spinning headless browser & synthesizing vector layout...
{}
Execution Failed
Failed to connect to worker.
Invoke this microservice programmatically from your backend application. Authenticate by passing your Lumoz API key in the Authorization: Bearer YOUR_API_KEY header.
curl -X POST https://lumozai.com/api/v1/services/run \
-H "Authorization: Bearer YOUR_LUMOZ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"service_id": "html-to-image",
"url": "https://lumozai.com",
"w": 1920,
"h": 1080
}'
import requests
url = "https://lumozai.com/api/v1/services/run"
headers = {
"Authorization": "Bearer YOUR_LUMOZ_API_KEY",
"Content-Type": "application/json"
}
payload = {
"service_id": "html-to-image",
"url": "https://lumozai.com",
"w": 1920,
"h": 1080
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print("Output:", data.get("output"))
print("Execution time:", data.get("execution_time"))
const response = await fetch("https://lumozai.com/api/v1/services/run", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_LUMOZ_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
service_id: "html-to-image",
url: "https://lumozai.com",
w: 1920,
h: 1080
})
});
const data = await response.json();
console.log("Output URL:", data.output);
Parameters Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
html |
string | Yes | - |
Raw HTML string with inline CSS, Google Fonts, or full web layout to render |
width |
integer | No | 1680 |
Viewport width in pixels (1 to 7680) |
height |
integer | No | 867 |
Viewport height in pixels (1 to 4320) |
file_type |
string | No | "webp" |
Output format: webp, png, jpg, or pdf |