# Images and text in pdfviewer is distorted and not clear in vision

**URL:** <https://forum.inductiveautomation.com/t/images-and-text-in-pdfviewer-is-distorted-and-not-clear-in-vision/58577>\
**Category:** Ignition\
**Tags:** database, vision, scripting, ignition81\
**Created:** [April 19, 2022, 4:38am UTC](https://forum.inductiveautomation.com/t/images-and-text-in-pdfviewer-is-distorted-and-not-clear-in-vision/58577 "2022-04-19T04:38:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vengatesan\_S](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@Vengatesan\_S](https://forum.inductiveautomation.com/u/Vengatesan_S)\
**Post date:** [April 19, 2022, 4:38am UTC](https://forum.inductiveautomation.com/t/images-and-text-in-pdfviewer-is-distorted-and-not-clear-in-vision/58577/1 "2022-04-19T04:38:11Z")

</div>

Hi,  
I am trying to open a user manual in Ignition vision. I have uploaded my pdf file using bytea datatype in the database table and i am trying to view the same in pdf viewer.  
But i found that text and images are not clear and seems to be distorted in the vision.  
Also i noticed that gateway connection was simultaneously disconnecting whenever i am opening the pdf.

Below is the script which i am using to view the pdf in pdf viewer from the database table.

bytes = system.db.runScalarQuery(“Select pdf from storepdf where id =%d” %(id),‘MySQL\_DB’)  
name = system.db.runScalarQuery(“Select name from storepdf where id =%d” (id),‘MySQL\_DB’)  
event.source.parent.getComponent(‘PDF Viewer’).loadPDFBytes(bytes, name)

Please let me know if there are any workarounds for this issue. Or is there any other way to open pdf in vision?

Any Help will be highly appreciated!

---

<div class="post-metadata">

**Author:** ![plo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/plo/32/33875_2.png) [@plo](https://forum.inductiveautomation.com/u/plo)\
**Post date:** [April 21, 2022, 9:45pm UTC](https://forum.inductiveautomation.com/t/images-and-text-in-pdfviewer-is-distorted-and-not-clear-in-vision/58577/2 "2022-04-21T21:45:20Z")

</div>

How are you storing the pdf into the Db? What does your insert query look like?

But here’s a Support Document where we discuss how to insert and display PDFs from the Database into a Vision PDF Viewer. Hope this helps! [Storing Files in a Database - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Storing+Files+in+a+Database)
