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?
I read elsewhere that Dejavu Sans support the Greek language.
Am I doing something else wrong? :?
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;
}
Did you install the fonts on your site? Are you loading them through functions.php?
I have done nothing like that. I need to figure out how I can do that now (lol).
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 (?).
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.
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;
}
If you copied the code as shown in the KB and it's not working, I suggest you open a ticket with Strategy 11.
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.
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
Thank you very much!
Please login or Register to submit your answer