Font rendering issue with PDF viewer

I store pdf BLOB in my DB. PDF is generatd in my report module with :

bytes = system.report.executeReport(path="WeekReportV4", project="home", parameters=reportParameters, fileType="pdf")

Then I put it in a PDF Viewer with :

event.source.parent.getComponent('PDF Viewer').loadPDFBytes(bytes, title)

The viewer show me this :

Do you know this issue ?
Thanks

The boxes indicate a problem rendering a font - specifically, that the font being used does not have representations for the characters it’s attempting to display. What font are those components in the report set to use?

2 Likes

Hi,
Ttile’s fonts are Segoe UI Semibold and Segoe UI Black.
Footer’s font is Arial.
Fonts in tables and charts are Dialog.

When I use Arial for all report. It works perfectly.
For example Arial Black is not works.
It reduces a lot the font’s choice.

It’s a limitation of the way we generate reports - the backing library does not support font embedding inside generated PDFs, so it relies on the fonts already in the system. There’s no real workaround, other than installing all required fonts at all locations these report PDFs might be viewed.

1 Like

OK.
Is there an other way to generate PDF in python ?

No, not really, unfortunately. You’d have to create a module that includes your own PDF generation code.

Does this require a gateway or client restart to implement? Tried installing the font on both the client and gateway server without success. In my case I am pulling a byte blob from the database and displaying it via PDF Viewer component.

Another key detail is that this happens to a specific server. When the same project is used on a different server, the PDF defaults to a different font instead of failing to render. Both servers are on Ignition 8.1.xx

I too have run into PDF Viewer issues as well.

Find a font that does render correct on all machines and manually make all the components use that font is the most straight foward way.

If you are able to show it via report viewer instead (ie your situation allows for creating on the fly instad of fetching a blob from the db/file) it will look right.

If you have the web dev module use the web browser to display a pdf file it will render correct.

If you save it and open it in adobe or pdf viewer application via shelling out, it will also look right.