The HTML Raster Node is located in the Function Nodes category and is used to convert an HTML document into a PNG image encoded in Base64.
In the video below, we walk you through the parameters needed to configure it:
Download the example flow using this link.
Below, you’ll find a description of the fields used in the process, as shown in the video.
Name (optional): Node name; you can change the default value here.
Input Type: URL or HTML.
If you select URL, enter the public URL of the HTML document. If the URL is not publicly accessible, the node won’t be able to process it.
If you select HTML, configure the variable that contains the HTML document in plain text.
CSS Selector (optional): Allows you to specify a DOM selector for partial rendering.
HTML Load Wait Time: Maximum time in seconds to wait for the page to load. (The default value is 1 second, and the maximum is 10 seconds).
Viewport Width (px): The width of the HTML document view in pixels. The default value is 800.
Viewport Height (px): The height of the HTML document view in pixels. The default value is 600.
Output Path: Name of the variable where the rasterized image will be stored.
Key Information:
- URLs pointing to files stored in platforms like Google Drive are not supported.
- The fields URL, CSS Selector, Viewport Width (px), and Viewport Height (px) support access to variables from the msg object using curly braces. For example, {{myParameter}} will insert the value contained in msg.myParameter.
- You can combine this node with an Image node to return the rasterized HTML as an integration response.
When testing, if you're using the HTML input type, add an Inject node before the HTML Raster Node, which must contain the HTML document in plain text. You'll need to reference that variable in the Node configuration.