• New Commercial Services Section

    We have now opened a commercial services section here on the forum. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.

    Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.

Problem with cirillic in dompdf

Thanks for the quick response. I decided to use a font already present in dompdf 'dejavu sans', as it already contains Cyrillic. Then I try to add a {font-family:! 'dejavu sans' important} file components/com_fabrik/views/form/tmpl/bootstrap/custom_css_example.php ? components/com_fabrik/views/details/tmpl/bootstrap/custom_css_example.php, but nothing has changed, and Cyrillic letters are also displayed with question marks, as in the admin panel and on the front-end. Replacement file "dompdf_config.inc.php" on
def("DOMPDF_DEFAULT_FONT","DejaVu Sans"), too, nothing has changed.
"Did I do something wrong?
 
Last edited:
Yup, wrong syntax
* {font-family:'dejavu sans'!important} (ie ! directly before important)
 
Thank you, but in my case it does not work. The default style is used for a detailed view and to form, in what place is not my attributes (try almost in every line), nothing changes. All the necessary library in php included. Very strange that the forced change of the default font in dompdf on dejavu is not working
 
I really can't replicate.

List, form, details PDF is showing Cirillic correctly (tested with ??????) if
* {font-family:'dejavu sans'!important}
is included in the particular templates selected as PDF templates.

Are you using the domPDF lib from Fabrik GitHub?
 
Hi!
I downloaded again from githab files, replaced them on the site. Nothing changed. It is possible that due to the fact that I'm using the default styles, I'm just not in that file I bring the font attribute (/components/com_fabrik/views/details/tmpl/bootstrap/custom_css_example.php)
PHP:
<?php
* {font-family:'dejavu sans'!important}
/**
* Default Form Template: Custom CSS
*
* @package     Joomla
* @subpackage  Fabrik
* @copyright   Copyright (C) 2005-2016  Media A-Team, Inc. - All rights reserved.
* @license     GNU/GPL http://www.gnu.org/copyleft/gpl.html
* @since       3.0
*/

/**
* If you need to make small adjustments or additions to the CSS for a Fabrik
* template, you can create a custom_css.php file, which will be loaded after
* the main template_css.php for the template.
*
* This file will be invoked as a PHP file, so the view type and form ID
* can be used in order to narrow the scope of any style changes.  You do
* this by prepending #{$view}_$c to any selectors you use.  This will become
* (say) #form_12, or #details_11, which will be the HTML ID of your form
* on the page.
*
* See examples below, which you should remove if you copy this file.
*
* Don't edit anything outside of the BEGIN and END comments.
*
* For more on custom CSS, see the Wiki at:
*
* http://www.fabrikar.com/forums/index.php?wiki/form-and-details-templates/#the-custom-css-file
*
* NOTE - for backward compatibility with Fabrik 2.1, and in case you
* just prefer a simpler CSS file, without the added PHP parsing that
* allows you to be be more specific in your selectors, we will also include
* a custom.css we find in the same location as this file.
*
*/

header('Content-type: text/css');
$c = (int) $_REQUEST['c'];
$view = isset($_REQUEST['view']) ? $_REQUEST['view'] : 'form';
$rowid = isset($_REQUEST['rowid']) ? $_REQUEST['rowid'] : '';
$form = $view . '_' . $c;
if ($rowid !== '')
{
    $form .= '_' . $rowid;
}
echo <<<EOT

/* BEGIN - Your CSS styling starts here */

#$form .foobar {
    display: none;
}

/* END - Your CSS styling ends here */

EOT;
 
Did you see
/* BEGIN - Your CSS styling starts here */
in custom_css.php?

+ you must rename or copy custom_css_example.php to custom_css.php
+ if you are modifiying in /details/bootstrap you must use the bootstrap template as PDF template (usually it's wise to create a custom template because domPDF has it's restrictions (e.g. with float..) and you have to adapt CSS which you don't want to be changed for the normal output)
http://www.fabrikar.com/forums/index.php?wiki/form-and-details-templates/
 
Last edited:
Thanks for the help!
Unfortunately it did not happen to make Cyrillic readable. It is unfortunate that this attribute (* {font-family:'dejavu sans'!important}) is not present in the template parts and the default form, because it universal and is suitable for most languages. He was eventually forced to use a ready-made solution to create PDF with the ability to convert both by dompdf and mpdf, tspdf, wkhtmltopdf
 
Last edited:
It's working if you are using Fabrik's PDF.

But if you have other stuff overriding Fabrik's functionality you have to solve it on this end on your own.
 
Hello dear masters. Help with displaying Cyrillic in PDF o_O


photo_2021-02-21_00-40-19.jpg
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top