Actions20
- AI Scrape Actions
- Analyze Sentiment Actions
- Convert to SQL Actions
- Generate Embedding Actions
- HTML to Any Actions
- Image Generation Actions
- Make Prediction Actions
- NSFW Detection Actions
- Object Detection Actions
- Process Image Actions
- Profanity Detection Actions
- Search Web Actions
- Spam Detection Actions
- Speech to Text Actions
- Spell Check Actions
- Summary Actions
- Text to Speech Actions
- Translate Actions
- Translate Image Actions
- Web Suggestion Actions
Overview
The "HTML to Any" operation in this node converts HTML content or a webpage URL into various output formats such as images (PNG, JPEG, WebP) or PDF documents. This is useful for scenarios where you want to capture visual representations of web pages or HTML snippets, for example:
- Generating screenshots of webpages for monitoring or archiving.
- Creating PDFs from dynamic HTML content for reports or invoices.
- Converting HTML emails or templates into image previews.
- Automating thumbnail generation for URLs.
By supporting both direct HTML input and URL fetching, it offers flexibility depending on whether the source content is local/generated or online.
Properties
Name | Meaning |
---|---|
Content Source | Choose the source of the content to convert: either a URL of a webpage or raw HTML content. |
URL | The URL of the webpage to capture. Required if Content Source is set to URL. |
HTML | The raw HTML content to convert. Required if Content Source is set to HTML. |
Output Type | The output file format. Options: PNG, JPEG, WebP (image formats), or PDF (document). |
Quality | Image quality (1-100) for JPEG and WebP formats. Higher values mean better quality but larger files. |
Full Page | Whether to capture the entire scrollable page instead of just the visible viewport. |
Omit Background | For PNG images, whether to make the background transparent. |
Width | Viewport width in pixels for rendering the page. |
Height | Viewport height in pixels for rendering the page. |
Scale | Device scale factor (minimum 1) controlling screenshot resolution. |
Size Preset | Predefined screen size presets (e.g., 2K, 4K UHD, HD, QVGA) to use instead of manually specifying width and height. |
Is Mobile | Emulate a mobile device viewport and respect meta viewport tags. |
Dark Mode | Force the page to render in dark mode using CSS media features. |
Use Graphic Renderer | Enable WebGL, GPU acceleration, and other 3D APIs. May impact performance and increase latency. |
Goto Options | JSON object with custom page load behavior settings like timeout and wait conditions (e.g., { "timeout": 15000, "wait_until": "networkidle0" } ). |
PDF Display Header Footer | For PDF output, whether to display header and footer. |
PDF Print Background | For PDF output, whether to print background graphics. |
PDF Page Range | For PDF output, specify page ranges to print (e.g., "1-5, 8, 11-13"). |
Return Type | Format to return the result: Base64 string, URL to the file, or binary data. |
Output
The node outputs the converted content in the specified format. The main output field is json
, which contains metadata and the actual content depending on the chosen return type:
- If Base64 is selected, the output includes a base64-encoded string of the image or PDF.
- If URL is selected, the output provides a URL pointing to the stored file.
- If Binary is selected, the output contains the binary data of the file attached to the item.
This allows downstream nodes to handle the output flexibly, e.g., saving to disk, uploading, or further processing.
Dependencies
- Requires access to the JigsawStack API service, which performs the HTML rendering and conversion.
- An API key credential must be configured in n8n to authenticate requests to the external service.
- Network access to the target URLs if capturing from a webpage URL.
- Optional: JSON parsing capability for custom goto options.
Troubleshooting
- Missing or invalid API key: The node will fail if the API key credential is not set or incorrect. Ensure the API key is valid and properly configured.
- Invalid URL or unreachable webpage: If the URL is incorrect or the server is down, the node cannot fetch the content. Verify the URL and network connectivity.
- Conflicting content source inputs: Providing both URL and HTML content simultaneously may cause errors. Only one should be provided based on the Content Source selection.
- Unsupported output type or invalid parameters: Selecting incompatible options (e.g., quality for PNG) might be ignored or cause warnings. Follow property constraints.
- Timeouts or slow loading: Complex pages or large timeouts in goto options can delay execution. Adjust timeout and wait conditions accordingly.
- Large output sizes: High-resolution images or PDFs can produce large files, potentially causing memory issues. Use appropriate scale and size presets.
Links and References
- JigsawStack API Documentation (for detailed API capabilities)
- n8n Documentation on Custom Nodes
- Web Screenshot Best Practices (general concepts related to webpage capture)