Perspective PDF Viewer - Public URLS Supported? - 8.04 nightly 08/14/19

I have been looking around the existing forum posts on the PDF Perspective viewer and am trying to clarify its capabilities.

I only know that:

   - You can't use a local file path on the gateway directly
   - To serve a pdf from the gateway itself to the viewer, you need to use WebDev module

Ideally, my ideal situation would be to serve public URLS from S3 or some other Cloud Object Storage, but I have been unable to get that working. So instead, as a sanity check, I tried various public PDFs with http urls I could find, but still had no luck.

The only PDF I can get to show is the default ‘pdf-sample.pdf’ that shows when a new pdf viewer component is added.

I cannot get public urls to work, I cannot add pdfs to the {ignition install directory}/webserver/webapps and reference them in the viewer (referencing PGriffith post: Perspective PDF viewer - #4 by PGriffith). I have not tried WebDev module, but I will if I cannot get any other working url example running.

I am using the latest 8.0.4 nightly build (as of 08/14/2019). Does anyone have any public url examples of pdf viewer working? Or do I need to go exclusively through the webdev module? Thank you!

To clarify - the reason you can’t use external URLs in the PDF viewer component is not due to some arbitrary decision made by Inductive Automation. Browsers, for a lot of very good reasons, especially security, implement something called CORS, which prevents a script running on one webpage from borrowing your browser session to run arbitrary requests on another domain. You may be able to get an S3 bucket to return the right CORS headers (this is not my area of expertise, but someone using the same library we are reported success with the same problem here), which would solve your issue.

Yes, thank you; it ended up being just the CORS config in AWS. CORS config in S3 -> Set Allowed Headers = * fixed.

1 Like