tcedi / tcedi-ovms

T.C.E.D.I. Open Visitors Management System
Apache License 2.0
23 stars 10 forks source link

FPDF error: Undefined font: helvetica B #8

Closed MeshJones closed 1 year ago

MeshJones commented 1 year ago

Hi. I've have been trying to print the badge and I keep getting the error "FPDF error: Undefined font: helvetica B". From my initial search the font being called is Arial so I'm not sure why I'm getting this. Any help would be appreciated. I'm really loving using TCEDI visitor management

tcedi commented 1 year ago

Hello,

The issue seems to be related to FPDF, which is used to generate the badge in PDF format in T.C.E.D.I. Open Visitors Management System.

As far as I know, when you use the font "Arial" it is replaced by the core font "helvetica" in FPDF...

Which version of PHP do you use?

Have you tried the branch dev015 (https://github.com/tcedi/tcedi-ovms/archive/refs/heads/dev015.zip) of T.C.E.D.I. Open Visitors Management System? It adds support for the latest versions of PHP, includes a newer version of FPDF as well as an option to try to define the FPDF_FONTPATH constant for FPDF, which might help in some rare cases. Of course, you'll have to follow the UPGRADE instructions available in README.TXT to upgrade from version 0.10 to version 0.15 (BETA 1). Don't forget to backup first ;-)!

I hope that this will help you somehow. If you try dev015 branch, I would be very happy to get your feedback (with the version[s] of PHP used)...

Best Regards, J-D

MeshJones commented 1 year ago

Hi J-D, I'm using PHP 8.1.2. I haven't tried the dev015 branch but I don't mind trying it out. Let me have a go at it and I'll get back to you if it solves my FPDF hurdle.

Wouldn't forget to backup first :)

I'll tell you how it goes

tcedi commented 1 year ago

Hi MeshJones,

If you are using PHP 8.1.2, dev015 branch should solve the issue. It adds PHP 8+ support, including for the FPDF library which has been upgraded.

Thank you in advance for your feedback.

Best Regards, J-D

MeshJones commented 1 year ago

Hi J-D,

The dev015 branch worked awesomely. It fixed the issue, and now I'm on to buying a Dymo LabelWriter printer so that I can start printing badges:). Thanks a lot