The source for the PDF can you use a file path??
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.
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.
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.
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?
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:
- In the designer, under the Web Dev context, create a File Resource
- Select your PDF and save it
- Now this creates the PDF as a web resource located at http://host:port/main/system/webdev/project_name/resource_name
- 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 (12.7 KB)
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.
It is a separate module, located here under āDevice Connectivityā.
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.
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.
Can you describe your usage of files a bit more? Files stored where? Used for what purpose?
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.
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.