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

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!

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