# How to transform HTML inside UI Template into a image?

**URL:** <https://discourse.nodered.org/t/how-to-transform-html-inside-ui-template-into-a-image/78636>\
**Category:** Dashboard\
**Created:** [23 May 2023 12:23 UTC](https://discourse.nodered.org/t/how-to-transform-html-inside-ui-template-into-a-image/78636 "2023-05-23T12:23:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Willianvcn](https://avatars.discourse-cdn.com/v4/letter/w/ebca7d/32.png) [@Willianvcn](https://discourse.nodered.org/u/Willianvcn)\
**Post date:** [23 May 2023 12:23 UTC](https://discourse.nodered.org/t/how-to-transform-html-inside-ui-template-into-a-image/78636/1 "2023-05-23T12:23:41Z")

</div>

Hi everyone,

I need help to understand if it's possible to generate a image file (.png or else) from a UI Template HTML code? There is some expecific node to do this? The reason is because I've a layout displayed with this HTML code and now I need to insert this into a PDF report that I'm creating.

 ![Capturar](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c6777fd46517f7f786381389f2429323a6daffc2.png)

[flowsSinotic.json](https://discourse.nodered.org/uploads/short-url/obrYBXC6GgKmZTK9WjVaNylx6hA.json) (11.5 KB)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 May 2023 13:11 UTC](https://discourse.nodered.org/t/how-to-transform-html-inside-ui-template-into-a-image/78636/2 "2023-05-23T13:11:13Z")

</div>

You should be able to use your browser or OS tools to capture an image of what is on-screen. Edge is particularly good for this, offering several capture methods. In many cases, you can also print direct to PDF - again dependent on your OS and/or browser.

---

<div class="post-metadata">

**Author:** ![Willianvcn](https://avatars.discourse-cdn.com/v4/letter/w/ebca7d/32.png) [@Willianvcn](https://discourse.nodered.org/u/Willianvcn)\
**Post date:** [24 May 2023 11:53 UTC](https://discourse.nodered.org/t/how-to-transform-html-inside-ui-template-into-a-image/78636/3 "2023-05-24T11:53:14Z")

</div>

Hi, thanks for the answer, but I think I wasn't that clear in my need.

This layout that I have attached is generated through an html/css code for a specific application. This application will now automatically generate periodic reports, so this image capture needs to be done automatically by the system. That is, what I need would be a solution on how to render this content so that I can generate an image to automatically place it in the report similar to this example here (where the person does it with graphics)

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2e560ff15cca1ec0eb7e4e161634c184791d4c63.jpeg "Generate chart images in Node-Red for email or chat messages") ](https://www.youtube.com/watch?v=bF-Q-LW5HsY)

Thanks!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [24 May 2023 12:14 UTC](https://discourse.nodered.org/t/how-to-transform-html-inside-ui-template-into-a-image/78636/4 "2023-05-24T12:14:43Z")

</div>

Are you saying that the page isn't generated from Node-RED? If that is the case, then the first task would be to grab the page into Node-RED and then output to PDF.

There are a number of nodes that can probably do this in either 1 or 2 steps. I would start by looking here:

[PDF - Node-RED Library](https://flows.nodered.org/search?term=pdf)

I noted at least one that can use Puppeteer (a headless browser library) that might be a good candidate to start looking at.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [23 June 2023 12:15 UTC](https://discourse.nodered.org/t/how-to-transform-html-inside-ui-template-into-a-image/78636/5 "2023-06-23T12:15:35Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
