# Check boxes not appearing in PDF Viewer in Vision

**URL:** <https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823>\
**Category:** Ignition\
**Created:** [April 25, 2022, 4:55pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823 "2022-04-25T16:55:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carly\_Jankowski](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@Carly\_Jankowski](https://forum.inductiveautomation.com/u/Carly_Jankowski)\
**Post date:** [April 25, 2022, 4:55pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/1 "2022-04-25T16:55:57Z")

</div>

I am currently trying to get checkmarks to display in a PDF Viewer after saving it as a report.  
The report looks as follows: the edit text under property inspector reads @taxable == 1 ? “☑”: “☐” @ since the data in the db is boolean. In the report “Preview” tab this appears as the following image (it also appears this way when saving the report as a PDF on the main window to our files):  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/d/0d80931b680217166881c997820d025182c41aff.png)  
However, on the PDF Viewer from that same window, after saving the report, the checkboxes appear to be empty:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f7638389c70ebb177147317f0de7854d51215de3.png)  
The font used is Arial as well.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 25, 2022, 4:58pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/2 "2022-04-25T16:58:04Z")

</div>

Everyone please welcome my coworker! @Carly_Jankowski

This is something we’ve been working on.

For reference we used this [Reporting checkboxes? - #4 by KathyApplebaum](https://forum.inductiveautomation.com/t/reporting-checkboxes/17503/4) post to get the logic of showing a checkbox or not.

---

<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:** [April 25, 2022, 7:00pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/3 "2022-04-25T19:00:55Z")

</div>

Do the checkboxes show in an external PDF Viewer application?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 26, 2022, 12:46pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/4 "2022-04-26T12:46:03Z")

</div>

We can save the reports via system.report.executeAndDistrbute, and those open correctly in external PDF Viewer programs like Adobe- I see Check marks.

When it is open in PDF from the database inside a PDF Viewer component on the same computer inside Ignition - I get boxes as though a character is missing.

---

<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:** [April 26, 2022, 12:52pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/5 "2022-04-26T12:52:53Z")

</div>

> [@bkarabinchak.psi](#):
>
> open correctly in external PDF Viewer

Huh. That wasn't the answer I was expecting.

~~No idea.~~ Maybe try different fonts?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 26, 2022, 1:44pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/6 "2022-04-26T13:44:02Z")

</div>

Our process is we have a gateway message handler make the PDF on the gateway and then immediately grab the file and save it to the database like this

```auto
	system.report.executeAndDistribute(path="VendorPO", project="PSM4_Project", parameters=reportingParameters, action="save", actionSettings=settings)
	fullFilePath = rootDir + "\\" + reportName
	bytes = system.file.readFileAsBytes(fullFilePath)
	system.db.runPrepUpdate("INSERT INTO listvendorPOPDFs (vendorPOId, PDFData) VALUES (?, ?)", [idx, bytes])

```

When looking at the PDF that was saved via exceuteAndDistribute I see the checkboxes, when I load the blob to PDF Viewer I do not.

We are using `Arial, Bold` as the font. Do you have any font suggestions that you think might work?

---

<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:** [April 26, 2022, 1:49pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/7 "2022-04-26T13:49:47Z")

</div>

Have you verified that the file and the DB contents are byte exact? Any possibility that the file isn’t finished writing when you grab it?

Consider not writing the file if you are just going to put it in the DB. Use `system.report.execute` and retrieve the PDF bytes directly to put in the DB.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 26, 2022, 2:08pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/8 "2022-04-26T14:08:19Z")

</div>

Ok tried it like so

```auto
settings = {"path":rootDir, "fileName":reportName, "format":"pdf"}
system.report.executeAndDistribute(path="VendorPO", project="PSM4_Project", parameters=reportingParameters, action="save", actionSettings=settings)
fullFilePath = rootDir + "\\" + reportName
bytes = system.report.executeReport(path='VendorPO', project='PSM4_Project', parameters=reportingParameters, fileType='pdf')
system.db.runPrepUpdate("INSERT INTO listvendorPOPDFs (vendorPOId, PDFData) VALUES (?, ?)", [idx, bytes])

```

Here it is via PDF Viewer component as retrieved from the database -  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/d/7d8768d451574db39816f999c76c43c2b4055cd5.png)

And here is the file opened directly from the PDF

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/c/accd981e6cbd7eaa10e84c499042654fce02b7bd.png)

I guess I will have to check if they are bytes exact at this point.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 26, 2022, 2:15pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/9 "2022-04-26T14:15:35Z")

</div>

They are bytes identical

```auto
path = 'C:\\Reports\\psm4,Project-0972-2022-1.pdf'
fileBytes = system.file.readFileAsBytes(path)
dbBytes = system.db.runScalarQuery("SELECT PDFData FROM listvendorpopdfs WHERE idx=1")

print fileBytes == dbBytes

```

This prints out true to me. So what the report saved on my file system is byte-identical to what is saved in the database blob column.

---

<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:** [April 26, 2022, 2:33pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/10 "2022-04-26T14:33:46Z")

</div>

Ok, _now_ I have no idea. I still suspect something to do with fonts.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 26, 2022, 2:42pm UTC](https://forum.inductiveautomation.com/t/check-boxes-not-appearing-in-pdf-viewer-in-vision/58823/11 "2022-04-26T14:42:10Z")

</div>

Idk about vision or whatever, But i vaguely remeber my mom having trouble opening a pdf a long time ago, because the pdf was created by a newer version of an editor(like adobe) which had a feature her pc didnt have yet.  
Maybe your checkbox is something of a “new pdf feature” the vision viewer cant handle?

Our old printer also had troubles printing pdfs becuase of this
