PDF supported fonts

By: Vassilis Mantas | Asked: 07/06/2023
ForumsCategory: General questionsPDF supported fonts
Vassilis Mantas asked 1 year ago
I am using the pdf-frm function to create a custom PDF from a view.  I type in the view half english and half greek so when the PDF is created the greek fonts turn to ? I have tried the frm_pdfs_css as in the example in knowledge base but it doesn't work (Dejavu Sans, sans-serif;). I am not a programmer so I am trying to find solution on this.  Do I need to use some other type of fonts in the css example code? How do I find what fonts should I use?  
5 Answers
Vassilis Mantas answered 1 year ago
I read elsewhere that Dejavu Sans support the Greek language.  Am I doing something else wrong? :? 
Vassilis Mantas answered 1 year ago
This is the lines I added in the Custom CSS in the Global Settings in Formidable plugin menu   add_filter('frm_pdfs_css', 'custom_font_pdfs_css', 10, 2); function custom_font_pdfs_css( $css, $args ) { $custom_css = 'body { font-family: Dejavu Sans; }'; return $css . $custom_css; }
Victor Font answered 1 year ago
Did you install the fonts on your site? Are you loading them through functions.php?
Vassilis Mantas answered 1 year ago
I have done nothing like that. I need to figure out how I can do that now (lol). 
Vassilis Mantas answered 1 year ago
 The following is written on the formidable forms KB for the "Use custom fond" code   By default, PDF files use font defined in Styles settings. If your language texts don't display correctly in the PDF file, you need to use a different font that supports your language. PDFs addon contains built-in Dejavu Sans font, which supports some languages like Hebrew, Polish, etc.... Use the following code snippet to use the Dejavu Sans font. Do I still need to load fonts? I have loaded font Dejavu sans in elementor custom fonts as ttf. Nothing changes, PDF still full of question marks (?).       
Victor Font replied 1 year ago

I saw that too after I asked about loading the font. The DejaVu font is included with dompdf, the tool that the PDF add-on is built upon. The body should be this: 'body { font-family: Dejavu Sans, sans-serif; }';. You truncated it when you copied it from the KB example.

Vassilis Mantas replied 1 year ago

Yes, I know that I missed a part (I did intentionally for a while to check), I have the full content like following and still doesn't work.

add_filter('frm_pdfs_css', 'custom_font_pdfs_css', 10, 2);
function custom_font_pdfs_css( $css, $args ) {
$custom_css = 'body { font-family: Dejavu Sans, sans-serif; }';
return $css . $custom_css;
}

Victor Font replied 1 year ago

If you copied the code as shown in the KB and it's not working, I suggest you open a ticket with Strategy 11.

Vassilis Mantas replied 1 year ago

Renewal of the license, actually buying a new license as mine is too old to renew, is needed in order to have the support to open a ticket. That is $200. I thought it would be something simple I just miss. If there is no simple solution from the community I will work it around without the PDF functionality, sadly.

Victor Font replied 1 year ago

Many of the community volunteers are full-time developers in their own right. Most custom code is not going to be a simple solution. In fact, to have someone write custom code will cost much more than the $200 it costs to renew your license.

In the meantime, here is a list of all the WordPress filters in the Formidable PDFs add-on. All have links to the Formidable Knowledgebase except frm_content. Formidable PDFs does not have any action hooks, only filters. Maybe you can find something you can use. This documentation is for the latest version of the add-on though. If you're not up to date with your license, you research results may be different.

https://formidable-masterminds.com/codexv2-filter-list/?header_id=3636

Vassilis Mantas replied 1 year ago

Thank you very much!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right