# Perspective PDF Viewer without WebDev

**URL:** <https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 21, 2021, 5:55pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874 "2021-04-21T17:55:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [April 21, 2021, 5:55pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/1 "2021-04-21T17:55:43Z")

</div>

So I know how to load PDFs from a database using the WebDev module. However I need to try and see if there is a way to load a PDF from a database without the WebDev module. Any ideas how to get it done? The PDFs are sitting in a database as a blob format.

---

<div class="post-metadata">

**Author:** ![jwilliams](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jwilliams](https://forum.inductiveautomation.com/u/jwilliams)\
**Post date:** [April 21, 2021, 5:53pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/2 "2021-04-21T17:53:30Z")

</div>

Using Perspective is there any way to view a PDF without the Web Dev module?  
I’ve seen a script [here](https://docs.inductiveautomation.com/display/DOC80/system.file.openFile) that uses _system.file.openFile_ to open specific files.

```auto
# This code would prompt the user to open a file of type 'pdf' from their stored documents folder. If None is returned, it means the user canceled the open dialog box.
# Note: the computer running this code needs to have network access to the "fileserver" computer.
path = system.file.openFile('pdf', '\\fileserver\PDF_Storage')
if path != None:
   # do something with the file

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 21, 2021, 5:58pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/3 "2021-04-21T17:58:04Z")

</div>

I don’t think so. [Data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) _might_ work…but probably only for very small PDFs, if at all (and have some serious performance implications anyways).

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [April 21, 2021, 6:17pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/4 "2021-04-21T18:17:59Z")

</div>

Ugh. OK not what I was hoping. It’s already tough enough for the Perspective license, then to try and get the customer to go for another module just to support this feature is almost an impossible sell.

We have an entire manual system built around PDFs in the database connected to our popups as well as a system library for the end user to put whatever they want into it. It all works awesome in Vision and was hoping that we could replicate that just with the Perspective license straight up. It’s unfortunate that this specific component relies heavily on another module.

Has there been any discussion of throwing in the WebDev as part of the perspective license?

---

<div class="post-metadata">

**Author:** ![Adriaan.leRoux](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Adriaan.leRoux](https://forum.inductiveautomation.com/u/Adriaan.leRoux)\
**Post date:** [April 21, 2021, 6:23pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/5 "2021-04-21T18:23:50Z")

</div>

Put your files in webserver/main/… and it publishes them like an IIS server would, you can then access them

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [April 21, 2021, 6:38pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/6 "2021-04-21T18:38:32Z")

</div>

Currently they are all in a database that we use across both Vision and eventually Perspective. If we can keep them in the database that would be ideal. that way there isn’t multiple copies running around. Plus we have a self service feature where the plant can upload what they want into the database so it’s available everywhere.

---

<div class="post-metadata">

**Author:** ![Adriaan.leRoux](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Adriaan.leRoux](https://forum.inductiveautomation.com/u/Adriaan.leRoux)\
**Post date:** [April 21, 2021, 6:40pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/7 "2021-04-21T18:40:08Z")

</div>

Can you use webdav/IIS to publish those files to the network?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [April 21, 2021, 7:01pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/8 "2021-04-21T19:01:19Z")

</div>

I’d like to be able to use Ignition to serve up files to the PDF Viewer in a Perspective environment similar to how it is being done in Vision. If there is an inherit limitation in the PDF Viewer Component, and it seems that there is, that in order to send it files you need to purchase another module, then we will probably just do a system.perspective.download for the file after it gets put together from the database. I’d rather have an all in one solution, but that is the second choice.

Most of our customers are of the lower budget variety with a couple of workstations running Ignition. So the addition of IIS or other servers in order to support sending a file from the database to the front end is a non starter in these environments.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 21, 2021, 8:02pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/9 "2021-04-21T20:02:09Z")

</div>

I _think_ our backend could theoretically support this in a way that would be reasonable - I made a ticket to investigate.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [April 21, 2021, 8:03pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/10 "2021-04-21T20:03:33Z")

</div>

Thanks I appreciate it. If you could just ping this thread with what you find out that would be awesome.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 5, 2021, 12:36pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/11 "2021-08-05T12:36:57Z")

</div>

@paul-griffith Do you know if anything came of this investigation?

---

<div class="post-metadata">

**Author:** ![meredithj](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@meredithj](https://forum.inductiveautomation.com/u/meredithj)\
**Post date:** [August 5, 2021, 3:09pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/12 "2021-08-05T15:09:22Z")

</div>

@bschroeder  
What you can do is have a gateway function that saves the file to the Ignition\webserver\webapps\main folder on the client. Ignition then will automagically render the image as a web path then {ip}/filename. I normally make a documents folder and save everything in there (so it is {ip}/documents/filename).

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 5, 2021, 3:11pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/13 "2021-08-05T15:11:48Z")

</div>

Does this data get sync’d up between gateways in redundancy?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 5, 2021, 3:13pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/14 "2021-08-05T15:13:45Z")

</div>

The ticket got changed around a bit, but ultimately ended up as a feature request on the Perspective team’s backlog. It’s at a medium priority, so all other things being equal it’ll get picked up ~soon, but bugs generally take priority over features, so it’s hard to give any kind of timeline.

The theoretical implementation would be a `getPdfBytes()` extension function, so that you can do whatever you need to on the backend to get your PDF content loaded, and the component will automatically handle ‘fetching’ it to the frontend.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 5, 2021, 3:15pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/15 "2021-08-05T15:15:00Z")

</div>

Awesome. I completely understand prioritizing bugs before this. I’m just glad that this is in progress. I appreciate your response.

---

<div class="post-metadata">

**Author:** ![drojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drojas/32/3403_2.png) [@drojas](https://forum.inductiveautomation.com/u/drojas)\
**Post date:** [February 10, 2022, 8:44pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/16 "2022-02-10T20:44:26Z")

</div>

Any updates on this feature? We need to be able to display PDF files by providing the bytes stored in a database. We are opting for this approach instead of the Report Viewer component because our reports take longer than the fixed timeout period of the component. So, we’ll run the reports on a schedule in the morning, then just provide links for users to see the finished PDF. Also, the Report Viewer component can’t seem to handle downloading large report PDFs or opening them in a new window…we always get the dreaded “Failed to Fetch” error.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 2, 2022, 7:21pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/17 "2022-04-02T19:21:15Z")

</div>

This does PDF files as easily as images....

> [@Automation Professionals' Blob Server Module](https://forum.inductiveautomation.com/t/automation-professionals-blob-server-module/57970):
>
> Automation Professionals is pleased to announce an alpha release of its new Blob Server Module. Available only for Ignition v8.1, here. The Blob Server Module provides a simple way to deliver images, PDF files, or other binary content from a database to your Perspective clients or other web applications. Without needing the WebDev module. All you need is a Named Query that has appropriate security settings and returns a single row with two columns: Content, and ContentType. Modest documentati…

{ /shameless plug }

---

<div class="post-metadata">

**Author:** ![drojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drojas/32/3403_2.png) [@drojas](https://forum.inductiveautomation.com/u/drojas)\
**Post date:** [April 4, 2022, 5:12pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/18 "2022-04-04T17:12:47Z")

</div>

Thanks Phil. I’ll do some testing with this and let you know if I find anything. If you would have finished this a day sooner I would have thought it to be a cruel April Fools joke. 🙂

One nice feature that cloud-based systems offer are expiring urls (and super long obfuscated GUID parameters). From what I understand on this module, if someone is crafty enough to enter in a different id parameter, they would access Blob data from a DB entry that they should have access to. Perhaps you are leaving the obfuscating part as an exercise for the student?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 4, 2022, 5:23pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/19 "2022-04-04T17:23:21Z")

</div>

> [@drojas](#):
>
> From what I understand on this module, if someone is crafty enough to enter in a different id parameter, they would access Blob data from a DB entry that they should have access to.

Correct. The security model for Named Queries is go/no-go just on user/roles/zones. No inspection of parameter values nor return values is done to qualify access. If you need that, stick with the WebDev module.

This module is for _ **simple** _ applications.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 4, 2022, 6:01pm UTC](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874/20 "2022-04-04T18:01:13Z")

</div>

> [@pturmel](#):
>
> This module is for _ **simple** _ applications.

Let me qualify this.

The module doesn't care how complicated the Named Query is. If you provide a table with `guid, id, expires` triplets, you could change my sample query to something like this:

```auto
Select blob as "Content", 'image/png' as "ContentType"
From images Inner Join transientImages On images.id = transientImages.id
Where transientImages.guid = :guid And current_timestamp < transientImages.expires

```

When you construct an image URL, generate a guid for it on the fly and insert it into `transientImages` with a suitable `expires` value.

[Next page](https://forum.inductiveautomation.com/t/perspective-pdf-viewer-without-webdev/45874.md?page=2)
