# Display PDF file on Dashboard

**URL:** <https://discourse.nodered.org/t/display-pdf-file-on-dashboard/9803>\
**Category:** Dashboard\
**Created:** [5 April 2019 11:34 UTC](https://discourse.nodered.org/t/display-pdf-file-on-dashboard/9803 "2019-04-05T11:34:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![silvia](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/silvia/32/7291_2.png) [@silvia](https://discourse.nodered.org/u/silvia)\
**Post date:** [5 April 2019 11:34 UTC](https://discourse.nodered.org/t/display-pdf-file-on-dashboard/9803/1 "2019-04-05T11:34:47Z")

</div>

Hi everyone,

I'm trying to display a local pdf file on the dashboard (the file path is C:\Users\Silvia\Downloads\test.pdf);

I've tried using a template node with this code on it, as seen on other posts:

```auto
<div>
    <a href="file:///C:\Users\Silvia\Downloads\test.pdf" type="application/pdf"><span>Link</span></a>
</div>

```

I've also tried different variations of it, like using iframe or embed, but nothing works ☹

If I copy this: file:///C:\Users\Silvia\Downloads\test.pdf on the browser tab then it works.

However, if I copy the same path onto the dashboard link, it doesn't work.

Any ideas about what I'm doing wrong, please?

**Additional info:**

- Running Node-Red on Windows 7 (hosted and accessing it locally -- it will eventually move to a Linux server)
- Node-Red version v0.18.4
- Node-Red-Dashboard v2.9.6
- The inject and the ui template node:

`[{"id":"337fba3e.8f9676","type":"inject","z":"f07539be.1a42e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":570,"y":200,"wires":[["eef3f4ba.042618"]]},{"id":"eef3f4ba.042618","type":"ui_template","z":"f07539be.1a42e8","group":"c7449154.b17ef","name":"","order":0,"width":0,"height":0,"format":"<div>\n <a href=\"file:///C:\\Users\\Silvia\\Downloads\\test.pdf\" type=\"application/pdf\"><span>Link</span></a>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":740,"y":200,"wires":[[]]},{"id":"c7449154.b17ef","type":"ui_group","z":"","name":"Default","tab":"b34fbabd.5b2438","disp":true,"width":"6","collapse":false},{"id":"b34fbabd.5b2438","type":"ui_tab","z":"","name":"Test","icon":"dashboard"}]`

Thanks 🙂

**[EDIT]:**  
Another approach I've tried is to use a http request, like described here: [https://stackoverflow.com/questions/40957970/node-red-upload-attachment-over-http](https://stackoverflow.com/questions/40957970/node-red-upload-attachment-over-http)

... but still no joy!

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [5 April 2019 16:09 UTC](https://discourse.nodered.org/t/display-pdf-file-on-dashboard/9803/2 "2019-04-05T16:09:22Z")

</div>

This is related to browser security. a `file://` tag is not allowed to point to a local file.  
If you check the web inspector\>console it will state: `not allowed to load local resource`

Solution is to make the file available on a (local/remote) webserver.

---

<div class="post-metadata">

**Author:** ![silvia](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/silvia/32/7291_2.png) [@silvia](https://discourse.nodered.org/u/silvia)\
**Post date:** [8 April 2019 10:04 UTC](https://discourse.nodered.org/t/display-pdf-file-on-dashboard/9803/3 "2019-04-08T10:04:09Z")

</div>

Thanks for your reply @bakman2

For anyone else in this situation... I've got round this problem using the Web Server for Chrome extension

---

<div class="post-metadata">

**Author:** ![carflomi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/carflomi/32/45646_2.png) [@carflomi](https://discourse.nodered.org/u/carflomi)\
**Post date:** [3 June 2022 16:09 UTC](https://discourse.nodered.org/t/display-pdf-file-on-dashboard/9803/4 "2022-06-03T16:09:55Z")

</div>

Hi.  
Thank you very much Silvia for sharing how you have solved your problem, in my case with your information I have been able to solve how to show a pdf from the dashboard.
