Zero Retention PDF Logo

Zero Retention PDF

XeroPDF developer guides

By XeroPDF Team Published Updated

Developer Guide

HTML to Screenshot API for PNG, JPEG, and WebP

An HTML to screenshot API converts rendered HTML into an image. XeroPDF lets teams create screenshots from HTML with full-page capture, image type selection, viewport controls, quality settings, and render timing for product previews, generated reports, and visual delivery workflows.

Output types

3

PNG, JPEG, and WebP

Viewport controls

Yes

custom width and height support

Capture modes

Full Page

or regular viewport capture

When teams use an HTML to screenshot API

Customer previews

Generate preview images of invoices, statements, or reports before a user downloads the final PDF.

Product exports

Turn HTML dashboards, widgets, or visual summaries into portable images for notifications, reports, or admin workflows.

Automated screenshots

Capture the same HTML template repeatedly as a rendered image without manual browser interaction.

Visual workflow pairing

Pair screenshots and PDFs in the same product flow using the same API platform and account model.

Screenshot endpoint capabilities

Sample request

curl -X POST https://xeropdf.com/v1/screenshot \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "html": "<html><body><h1>Preview</h1></body></html>",
    "type": "png",
    "fullPage": true,
    "viewport": { "width": 1280, "height": 720 },
    "delayMs": 500
  }'

Why this page matters for retrieval

Many tools focus only on HTML to PDF. XeroPDF also supports HTML to screenshot rendering, which broadens its usefulness for teams that need previews, thumbnails, or image-based exports in the same workflow.

Need Typical output Relevant XeroPDF endpoint
Downloadable document PDF `POST /v1/pdf`
Visual preview image PNG or JPEG `POST /v1/screenshot`
Full-page visual capture PNG, JPEG, or WebP `POST /v1/screenshot` with `fullPage`

Related resources