How to add fonts to the PDF Template editor


The PDF Template editor only has a very limited set of available fonts.

How do you add extra fonts to the PDF Template editor ?


Which SuiteCRM version?

Which PDF Template functions are thinking of? I just want to make sure I’m thinking of the same thing. I assume it’s when you create templates from the PDF Templates module and use generate letter in a detail view, am I right?

We are running SuiteCRM 8.1.3

From the “More” pull down menu I select “PDF - Templates”.

I have created a new “Quote” template using the “Quote Sample” as the base design.

Since starting this thread I’ve also attempted to modify the design with the WYSIWYG editor and I have to say that not much works expect for changing text.

If you try and change the number or rows and columns of a pre-exisitng table no changes are made.

If you try and add a new table the table is compressed and if you add text to a cell the padding and spacing is wrong.

I have done a lot of professional html coding and produced many custom reports from sql databases using various tools but I have to say the built in SuiteCRM WYSIWYG editor is very basics indeed. As end documents are customer facing I would have expected SuiteCRM to have a more advanced PDF Template editor. Is the developer community working on any improvements to the editor or replacing it completely ?

I have looked at the html code and considered editing it directly however after reading through some other forum threads on the subject this may not be simple. Some say if you make changes to the html it can be stripped off when its saved. Others have resorted to editing the code directly in the database.

I will need to create a lot of custom layouts. How are others customising forms using the PDF-Templates editor ?

Can you use a different html editor and paste the code into the built in editor . Will it save correctly or does it strip off html code ?

Do you have to save custom code directly into the database by passing the WYSIWYG editor completely ?

And my original question. The editor only has a limited set of fonts. How do you add extras fonts ?

Yes, me (PowerReplacer). And a bunch of other add-on developers, have a look in the Store.

Part of my fixes were directed at the editing problems you mention (such as stripping HTML tags and other types of excessively zealous “security” clean-ups).

Regarding the fonts, I don’t know exactly how, but maybe try editing this configuration here

SuiteCRM/generatePdf.php at master · salesagility/SuiteCRM · GitHub

and check the online TCPDF documentation to see what is possible.

There’s very similar code here:

SuiteCRM/formLetterPdf.php at master · salesagility/SuiteCRM · GitHub

  • formLetterPdf.php is the (old SugarCRM?) “Print as PDF” button

  • generatePdf.php is the SalesAgility AOS version of PDF generation from several modules (Quotes, Invoices, Contracts, …). It’s button “EmailPDF” and sends emails.