The HTML To Any API allows you to capture high-quality screenshots of any webpage or HTML content. This powerful tool enables you to generate images in various formats (PNG, JPEG, WebP) or PDF documents with extensive customization options for different use cases.
High-quality website captures with customizable resolution
Support for multiple output formats (PNG, JPEG, WebP, PDF)
Full-page screenshots that capture entire scrollable content
// Optimize load time by only waiting for essential elementsconst result = await jigsaw.web.html_to_any({ url: "https://example.com", goto_options: { wait_until: "domcontentloaded", // Faster than waiting for full load timeout: 5000 // Shorter timeout for quicker response }, quality: 70, // Lower quality for faster processing type: "jpeg" // Usually processes faster than PNG});
For SPAs or dynamic content that requires extra time to load:
Copy
// Give more time for JavaScript-heavy pages to renderconst result = await jigsaw.web.html_to_any({ url: "https://dynamic-spa-example.com", goto_options: { wait_until: "networkidle0", // Wait until network is idle timeout: 15000 // Extended timeout for dynamic content }, full_page: true});
What’s the difference between capturing by URL vs. HTML?
When you provide a URL, the API loads the complete webpage including all external resources like JavaScript, CSS, and images. When you provide HTML directly, you need to ensure all resources are either embedded or accessible via absolute URLs.
By default, the API waits for the window.load event with a timeout of 15 seconds. You can customize this behavior using the goto_options parameter to wait for different events like domcontentloaded or networkidle0.