# Node-red-html-to-pdf Error

**URL:** <https://discourse.nodered.org/t/node-red-html-to-pdf-error/77143>\
**Category:** General\
**Tags:** docker\
**Created:** [1 April 2023 16:46 UTC](https://discourse.nodered.org/t/node-red-html-to-pdf-error/77143 "2023-04-01T16:46:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WilsonOviedo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wilsonoviedo/32/78207_2.png) [@WilsonOviedo](https://discourse.nodered.org/u/WilsonOviedo)\
**Post date:** [1 April 2023 16:46 UTC](https://discourse.nodered.org/t/node-red-html-to-pdf-error/77143/1 "2023-04-01T16:46:18Z")

</div>

Hi, i'm use html to pdf node, when i send html to node, return this error:

> TypeError: Cannot read properties of undefined (reading 'split')

This is my code:

```auto
[
    {
        "id": "3f78bec97e2f1517",
        "type": "html-to-pdf",
        "z": "926d9efbb492c064",
        "name": "",
        "format": "A4",
        "zoom": 100,
        "orientation": "Portrait",
        "width": "",
        "height": "",
        "widthUnit": "cm",
        "heightUnit": "cm",
        "marginTop": 1,
        "marginLeft": 1,
        "marginBottom": 1,
        "marginRight": 1,
        "marginTopUnits": "cm",
        "marginLeftUnits": "cm",
        "marginBottomUnits": "cm",
        "marginRightUnits": "cm",
        "omitBackground": false,
        "printGraphics": true,
        "x": 370,
        "y": 260,
        "wires": [
            [
                "323ae64d46b2979b"
            ]
        ]
    },
    {
        "id": "b6d73b18.9b6a48",
        "type": "template",
        "z": "926d9efbb492c064",
        "name": "",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "<table>\n <thead>\n <tr>\n <th>Nombre</th>\n <th>Apellido</th>\n <th>Edad</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>John</td>\n <td>Doe</td>\n <td>30</td>\n </tr>\n <tr>\n <td>Jane</td>\n <td>Doe</td>\n <td>25</td>\n </tr>\n </tbody>\n</table>",
        "output": "str",
        "x": 160,
        "y": 260,
        "wires": [
            [
                "1af36e33.48c6c7",
                "3f78bec97e2f1517",
                "bc46de2db8066611"
            ]
        ]
    },
    {
        "id": "1af36e33.48c6c7",
        "type": "debug",
        "z": "926d9efbb492c064",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 410,
        "y": 180,
        "wires": []
    },
    {
        "id": "323ae64d46b2979b",
        "type": "debug",
        "z": "926d9efbb492c064",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 260,
        "wires": []
    },
    {
        "id": "01fc7c38c7d214e2",
        "type": "inject",
        "z": "926d9efbb492c064",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 120,
        "wires": [
            [
                "b6d73b18.9b6a48"
            ]
        ]
    },
    {
        "id": "bc46de2db8066611",
        "type": "function",
        "z": "926d9efbb492c064",
        "name": "function 1",
        "func": "msg.html = msg.payload;\nmsg.filename = \"test.pdf\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 200,
        "y": 420,
        "wires": [
            [
                "156d280183658352"
            ]
        ]
    },
    {
        "id": "156d280183658352",
        "type": "html-to-pdf",
        "z": "926d9efbb492c064",
        "name": "",
        "format": "A4",
        "zoom": 100,
        "orientation": "Portrait",
        "width": "",
        "height": "",
        "widthUnit": "cm",
        "heightUnit": "cm",
        "marginTop": 1,
        "marginLeft": 1,
        "marginBottom": 1,
        "marginRight": 1,
        "marginTopUnits": "cm",
        "marginLeftUnits": "cm",
        "marginBottomUnits": "cm",
        "marginRightUnits": "cm",
        "omitBackground": false,
        "printGraphics": true,
        "x": 450,
        "y": 500,
        "wires": [
            [
                "a28316945f0fda9e"
            ]
        ]
    },
    {
        "id": "a28316945f0fda9e",
        "type": "debug",
        "z": "926d9efbb492c064",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 670,
        "y": 500,
        "wires": []
    }
]

```

I have everything running in a docker container with the following version: nodered/node-red:3.0.2  
What can be wrong? I can't find much documentation with examples of how to use it correctly, or maybe I'm not looking for it right.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [1 April 2023 17:10 UTC](https://discourse.nodered.org/t/node-red-html-to-pdf-error/77143/2 "2023-04-01T17:10:22Z")

</div>

Hi @WilsonOviedo - Welcome to the forums

I'm not sure of any prerequisites in using this node (assuming all required libs are installed)  
but your code seems fine - You will need to raise this issue with the author of the node.

---

<div class="post-metadata">

**Author:** ![WilsonOviedo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wilsonoviedo/32/78207_2.png) [@WilsonOviedo](https://discourse.nodered.org/u/WilsonOviedo)\
**Post date:** [1 April 2023 17:33 UTC](https://discourse.nodered.org/t/node-red-html-to-pdf-error/77143/3 "2023-04-01T17:33:42Z")

</div>

Hi, @marcus-j-davies, thaks  
There is no mention of any prerequisites to install it. I will make your suggestion, I will ask the author.  
Thank you very much for your answer.

---

<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:** [31 May 2023 17:34 UTC](https://discourse.nodered.org/t/node-red-html-to-pdf-error/77143/4 "2023-05-31T17:34:13Z")

</div>

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