Check boxes not appearing in PDF Viewer in Vision

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 ? “:ballot_box_with_check:”: “☐” @ 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
However, on the PDF Viewer from that same window, after saving the report, the checkboxes appear to be empty:
image
The font used is Arial as well.

1 Like

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 post to get the logic of showing a checkbox or not.

2 Likes

Do the checkboxes show in an external PDF Viewer application?

1 Like

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.

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

No idea. Maybe try different fonts?

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

	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?

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.

1 Like

Ok tried it like so

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

And here is the file opened directly from the PDF

image

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

They are bytes identical

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.

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

1 Like

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