# PDF viewer perspective with document as bytes

**URL:** <https://forum.inductiveautomation.com/t/pdf-viewer-perspective-with-document-as-bytes/79108>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 13, 2023, 7:01pm UTC](https://forum.inductiveautomation.com/t/pdf-viewer-perspective-with-document-as-bytes/79108 "2023-09-13T19:01:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marianjel\_11](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@marianjel\_11](https://forum.inductiveautomation.com/u/marianjel_11)\
**Post date:** [September 13, 2023, 7:01pm UTC](https://forum.inductiveautomation.com/t/pdf-viewer-perspective-with-document-as-bytes/79108/1 "2023-09-13T19:01:24Z")

</div>

Hi, I have a project and the document management is in a shared disk, the .conf is already configured to view the documents, I already have the functionality to insert the documents, and now I need to read them and show them in the PDF viewer, I can see the document with the function "readFileAsBytes" but it marks a configuration error in the PDF.

---

<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:** [September 13, 2023, 7:50pm UTC](https://forum.inductiveautomation.com/t/pdf-viewer-perspective-with-document-as-bytes/79108/2 "2023-09-13T19:50:44Z")

</div>

Sounds like you are trying to convert a Vision app, where you can supply bytes directly to the PDF viewer component.

Perspective's PDF viewer needs a URL, because it is a browser. And browser won't let you access `file://` URLs from within another page, for security reasons. You will need to serve those files to your browser via another webserver with IFrame-compatible headers (cross-site aka CORS headers), or serve them from Ignition itself via the WebDev module.

If you have the option to put your PDFs in a database as blobs, you could as use my free Blob Server module:

> [@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…
