# Convert HTML Document to a PDF-Document

**URL:** <https://discourse.nodered.org/t/convert-html-document-to-a-pdf-document/57013>\
**Category:** General\
**Created:** [21 January 2022 13:45 UTC](https://discourse.nodered.org/t/convert-html-document-to-a-pdf-document/57013 "2022-01-21T13:45:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlackBull2599](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@BlackBull2599](https://discourse.nodered.org/u/BlackBull2599)\
**Post date:** [21 January 2022 13:45 UTC](https://discourse.nodered.org/t/convert-html-document-to-a-pdf-document/57013/1 "2022-01-21T13:45:54Z")

</div>

Hello people,  
I hope one of you can help me. I have the problem that when I convert an HTML document to a pdf document via Node-Red that an image that is in the HTML file is not displayed. When I do the conversion manually through the console of my RevolutionPi, the image is displayed...  
I create the HTML doc in advance via Node-Red and start the conversion process via the Exec Node using the tool wkhtmltopdf. Does anyone know where the error lies there or knows a suitable alternative that i can convert a HTML file to a pdf File? I am new to the topic and hope for your help!!!  
Thanks a lot!

---

<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:** [21 January 2022 15:53 UTC](https://discourse.nodered.org/t/convert-html-document-to-a-pdf-document/57013/2 "2022-01-21T15:53:08Z")

</div>

I would imagine that will be because of the location of the image file. Take a look at the HTML and see where the image is requested from. Perhaps your tool cannot get to the image - maybe it can't make web requests?

---

<div class="post-metadata">

**Author:** ![BlackBull2599](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@BlackBull2599](https://discourse.nodered.org/u/BlackBull2599)\
**Post date:** [21 January 2022 16:48 UTC](https://discourse.nodered.org/t/convert-html-document-to-a-pdf-document/57013/3 "2022-01-21T16:48:23Z")

</div>

Thank you for your answer. But the path in the HTML Document is the same as the file is. When the tool couldn't get to the image, it shouldn't work when i make it manually. But this works...

---

<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:** [21 January 2022 22:51 UTC](https://discourse.nodered.org/t/convert-html-document-to-a-pdf-document/57013/4 "2022-01-21T22:51:17Z")

</div>

Perhaps the tool doesn't like the image type?

Maybe switch to something like Pandoc?

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [21 January 2022 23:23 UTC](https://discourse.nodered.org/t/convert-html-document-to-a-pdf-document/57013/5 "2022-01-21T23:23:04Z")

</div>

Can you give us an example of the image urls that are not working for you? Is the html page served from a url, or in a local file?

I have had some mixed success with the [HTML-PDF](https://flows.nodered.org/node/node-red-contrib-pdf) node... although the code is pretty old, and does not handle overly complicated html pages (or any dynamic JS/DOM manipulation).

---

<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:** [22 March 2022 23:23 UTC](https://discourse.nodered.org/t/convert-html-document-to-a-pdf-document/57013/6 "2022-03-22T23:23:19Z")

</div>

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