How can I set "Meiryo" font for PDF file?

Hi everybody,
There is a option in report module in suiteCRM called “Download PDF”. I want to add a specific font for the PDF file like “Meiryo”.
In the AOR_Report/controller.php file, there is a function called "“protected function action_downloadPDF()” has following line.

$pdf = new mPDF(‘en’, ‘A4-L’, ‘’,’’) ;
$pdf->SetAutoFont();
How can I set up this specific font like “Meiryo” for PDF file.
Is there anyone who can help me about it? I need help.

Thanks in advance
Nahar

I suspect you are using SuiteCRM 7.11.x? Let us know the version you are using as 7.12.x now has an updated PDF library.

IF it’s 7.11.x have a look at the documentation of mPDF here for adding Fonts. Fonts in mPDF 5.x – Fonts & Languages – mPDF Manual That SetAutoFonts I don’t believe it’s implying to be, but it detects the language of the input/characters to pick right font for that language i.e. german, chinese etc.

The config_fonts are in this directory in 7.11.x https://github.com/salesagility/SuiteCRM/tree/7.11.x/modules/AOS_PDF_Templates/PDF_Lib

How to make this upgrade safe I’m not quite sure, but it’s a starting point.

Hi @samus-aran ,
Thanks for your reply.
I am using SuiteCRM 7.11.21.

Awesome, then my suggestions should apply.

but how can setup MEiryo font for PDF file?

You’ll need to apply this MEiryo font by including it into the library. This will need to be done by code.

Pulling steps from the documentation I sent you.

Easy to add new fonts (Fonts in mPDF 5.x – Fonts & Languages – mPDF Manual)

  1. Upload the Truetype font file to the fonts directory (/ttfonts)
  2. Define the font file details in the configuration file (config_fonts.php)
  3. Access the font by specifying it in your HTML code as the CSS font-family
  4. To use the font with specific languages, you need also to edit the configuration file (config_cp.php) - see the example

Lets do this first and take it from here.