# \[Question\] PDF Viewer File Path

**URL:** <https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715>\
**Category:** Ignition Early Access\
**Created:** [November 9, 2018, 2:44pm UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715 "2018-11-09T14:44:48Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianboudreau](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brianboudreau/32/6528_2.png) [@brianboudreau](https://forum.inductiveautomation.com/u/brianboudreau)\
**Post date:** [November 9, 2018, 2:44pm UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/1 "2018-11-09T14:44:48Z")

</div>

The source for the PDF can you use a file path??

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e6ec61d9ab38bd3d4b8329d60b6eedaf5e9a44aa.jpg)

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 9, 2018, 4:22pm UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/2 "2018-11-09T16:22:19Z")

</div>

Remember that we’re operating in a browser environment now, so the browser is only able to load things up that are served up over HTTP. This means that the source of the PDF needs to be a URL.

If you have PDFs on a filesystem that the gateway can access, you might need to use WebDev to stream the PDF bytes over HTTP.

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [February 21, 2019, 12:35am UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/3 "2019-02-21T00:35:06Z")

</div>

Is there any documentation available on how this might be achieved? I have several PDF’s on my gateway PC that I would like to be able to embed into a Perspective view.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 21, 2019, 3:36pm UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/4 "2019-02-21T15:36:32Z")

</div>

[https://docs.inductiveautomation.com/display/DOC80/Perspective+-+PDF+Viewer](https://docs.inductiveautomation.com/display/DOC80/Perspective+-+PDF+Viewer)

~~Remember that paths are relative to project, so placing the .pdf file within a project directory of MyProject/PDFFiles and naming the file MyPDF.pdf should have a path like ‘/PDFFiles/MyPDF.pdf’ when being used within the MyProject project.~~

I’m going to recuse myself from answering this question because even I don’t fully understand how to use a .pdf in Perspective. In speaking with Development, it sounds like any .pdf file would have to be served up by the Gateway, which would mean you would need to be using the WebDev Module to serve the .pdf by placing it into a mounted folder. You would then supply the path to the file. I’ll ask around and try to get some more information, but you’d probably be best-served by getting someone else to answer this question.

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [February 21, 2019, 10:08pm UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/5 "2019-02-21T22:08:47Z")

</div>

I found the manual page for the Perspective PDF Viewer component, but it doesn’t yet have any details on the correct path.

I’ve tried putting a folder called ReferenceDocuments in `C:\Program Files\Inductive Automation\Ignition\data\projects\[project name]`, and put a PDF file in there called `Test.pdf`. I’ve then made the source for the PDF viewer `\ReferenceDocuments\test.pdf`, and I’m still just getting the “failed to load PDF file” error. Have I got the wrong project directory, or am I doing something else wrong?

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [February 22, 2019, 4:41pm UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/6 "2019-02-22T16:41:52Z")

</div>

The thing about the PDF viewer in Perspective is that it must be served via an HTTP request like Carl said above and cannot use the path on the file system. Luckily, this can be easily achieved using the webdev module with these simple steps:

1. In the designer, under the Web Dev context, create a File Resource
2. Select your PDF and save it
3. Now this creates the PDF as a web resource located at [http://host](http://host):port/main/system/webdev/project\_name/resource\_name
4. Now go back to Perspective and in the PDF viewer source property, you should be able to enter something like /system/webdev/project\_name/resource\_name

I’ve attached a simple project to this comment with a sample PDF viewer using a webdev PDF file.[PDF\_Test.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1bd4847140924a2d1a3d4c532d382a600a8437be.zip) (12.7 KB)

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [February 23, 2019, 2:08am UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/7 "2019-02-23T02:08:47Z")

</div>

Thanks, that clears it up, I’ll give it a try when I’m back in the office.

Is the Web Dev context you’re referring to the “Web Development Module” available as a separate module, or is there a webdev module of some kind built into the perspective module? I haven’t yet organised the purchase of a license for my application, so if it’s a separate module I’ll just have to shoot my rep an email and get it added in to my quote.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 25, 2019, 3:16pm UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/8 "2019-02-25T15:16:23Z")

</div>

It is a separate module, located [here](https://inductiveautomation.com/downloads/ignition) under “Device Connectivity”.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 26, 2019, 12:11am UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/9 "2019-02-26T00:11:42Z")

</div>

So there will be no file access with Perspective from the clients?  
We use a ton of files for all kinds of different things in Vision, this will be a deal breaker for us. ☹

---

<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:** [February 26, 2019, 12:19am UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/10 "2019-02-26T00:19:28Z")

</div>

There’s literally no way around it - it’s just the way file access works in web browsers. At some point we may streamline that webdev process, but it’s _dangerous_ to expose files on the gateway to every web browser that happens to connect to Ignition. Making it harder makes it less likely someone does something by mistake that causes them lots of problems down the road.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [February 26, 2019, 12:32am UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/11 "2019-02-26T00:32:32Z")

</div>

Can you describe your usage of files a bit more? Files stored where? Used for what purpose?

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 26, 2019, 12:49am UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/12 "2019-02-26T00:49:40Z")

</div>

Oh boy where to start…  
We download xml files using Oracle web methods and then process them.  
We create xml files and process them.  
We create PDF files, edit PDF files, email them around, store them, view them, etc.  
We parse Rockwell L5k and L5x files and then generate XML tag imports for use in Ignition.  
We parse Wonderware tag DB Dump CSV files and create XML tag import files.  
We parse and create tags from a proprietary system to Ignition and our databases.  
We capture, edit and store image files from Cognex cameras.  
We create, edit, and view PDF Lockout/Tagout files, VWI files, images for those.  
That’s just off the top of my head, there is more.  
@Paul.Scott is familiar with our systems and the complexity of them.

---

<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:** [February 26, 2019, 1:09pm UTC](https://forum.inductiveautomation.com/t/question-pdf-viewer-file-path/20715/13 "2019-02-26T13:09:48Z")

</div>

> [@MMaynard](#):
>
> Oh boy where to start…

IA is not getting rid of Vision -- at least not for several years, so I have been assured. Running super complex, _ **custom** _ tasks in a web browser is not something easily supported in a secure way. Your list is likely to be Vision-only for quite a while yet. And some may never get to Perspective.
