Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts not correct in PDF Download/Creation #9056

Open
ipbroad opened this issue Mar 8, 2021 · 4 comments
Open

Fonts not correct in PDF Download/Creation #9056

ipbroad opened this issue Mar 8, 2021 · 4 comments
Labels
Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type:Bug Bugs within the core SuiteCRM codebase

Comments

@ipbroad
Copy link

ipbroad commented Mar 8, 2021

Hi all, not sure what I am doing wrong. I’ve changed the font in a pdf template to what I want but when I come to print/download/email the PDF it has not changed. All the HTML is correct to what I want and on screen in the editor it has changed but when I come to print it has not. For the life of me I cannot figure what I am doing wrong. Many thanks for any help.

@johnM2401 johnM2401 added Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type:Bug Bugs within the core SuiteCRM codebase labels Mar 9, 2021
@johnM2401
Copy link
Contributor

johnM2401 commented Mar 9, 2021

If you could fill in as much of the template as possible when raising an issue, (Such as SuiteCRM Version/PHP Version/Steps to replicate), that would be very much appreciated and would help any developers investigating the issue.

Also, if you could provide some examples of Fonts used, that would also be appreciated

Thanks for raising!
 
 

Relevant Forum Thread: https://community.suitecrm.com/t/fonts-in-pdf-not-working/78716/

@tsmgeek
Copy link
Contributor

tsmgeek commented Mar 9, 2021

Built in mPDF 5.x supports specific fonts by default

https://mpdf.github.io/fonts-languages/fonts-in-mpdf-5-x.html
https://github.com/salesagility/SuiteCRM/blob/master/modules/AOS_PDF_Templates/PDF_Lib/config_fonts.php
https://github.com/salesagility/SuiteCRM/tree/master/modules/AOS_PDF_Templates/PDF_Lib/ttfonts

I found that I had to slipstream in and override the config_fonts.php file and add in my custom fonts.

mPDF 7.x is easier but SuiteCRM has not yet upgraded to add hooks directly for fonts, its harder unless they upgrade to later mPDF.

afaik

@ipbroad
Copy link
Author

ipbroad commented Mar 15, 2021

thanks tsmgeek I tried the above and no luck - everything is the latest version but no matter what I try this just doesn't work.

@maadc
Copy link

maadc commented Mar 27, 2021

cherub-chum explained the issue in the Forum Thread .

TinyMC and your browser are using different fonts then the module which prints the pdf's. Thus you have to add the fonts manually in mPDF.

  1. Open SuiteCRM/modules/AOS_PDF_Templates/PDF_Lib/config_fonts.php
  2. There you will find the array fontdata. It was at line 94 in my file.
  3. You have to add your fonts there, just like the already added ones. In the comment above the array is a little instruction.
  4. Upload you fonts to the font-folder: /public_html/SuiteCRM/modules/AOS_PDF_Templates/PDF_Lib/ttfonts

There you go. Problem solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type:Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

4 participants