Dompdf couldn't work normally with Chinese characters

Try with Fabrik's PDF debug enabled and check if all is loaded correctly.

And try with php8.2
 
Thanks.Now debeg fabrik and debug pdf enabled.There were error tips:

Uncaught ReferenceError: jQuery is not defined
at jquery-ui.min.js:6:88
at jquery-ui.min.js:6:96
tex-mml-chtml.js:1 MathJax(?): Can't find handler for document
notify.min.js?v=500:14 Uncaught TypeError: Cannot set properties of undefined (setting 'notify')
at notify.min.js:14:7430
at notify.min.js:13:2
at notify.min.js:14:2
130?format=pdf&resetfilters=0&setListRefFromRequest=1&listref=130_com_fabrik_130:212 Uncaught ReferenceError: jQuery is not defined
at 130:212:13

Screenshots attached.
 

Attachments

  • dompdferror02.JPG
    dompdferror02.JPG
    14.1 KB · Views: 8
  • dompdferror01.JPG
    dompdferror01.JPG
    29.1 KB · Views: 8
JS shouldn't matter for PDF.
Check in the browser if the CSS is loaded correctly.
I don't think F4 and domPDF are php8.3 ready.
You may turn J! error reporting on, Fabrik PDF debug off and see if there are any errors/warnings etc in the PDF file (open with e.g. notepad++)

Do you have a link to your list?
 
Thanks troester,
There are errors when turn J! error reporting on, Fabrik PDF debug off:
Deprecated: Creation of dynamic property T4\MVC\Router\T4::$config is deprecated in /var/www/html/plugins/system/t4/src/t4/MVC/Router/T4.php on line 87

Deprecated: Creation of dynamic property Fabrik\Document\PdfDocument::$engine is deprecated in /var/www/html/libraries/fabrik/fabrik/fabrik/Document/PdfDocument.php on line 185

Warning: Array to string conversion in /var/www/html/libraries/fabrik/fabrik/fabrik/Document/Renderer/Pdf/HeadRenderer.php on line 364

Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /var/www/html/libraries/fabrik/fabrik/fabrik/Document/PdfDocument.php on line 275
Unable to stream pdf: headers already sent
 

Attachments

  • dompdferror03.JPG
    dompdferror03.JPG
    57 KB · Views: 7
Those are solely deprecated messages. Turn Joomla error reporting to None and see if the pdf gets generated.
 
Downloading e.g. Noto Sans TC into my J! root and adding


Code:
...
echo <<<EOT
    @font-face {
        font-family: 'Noto Sans TC';
       font-weight: normal;
                font-style: normal;
                font-variant: normal;
        src: url('http://localhost/j4h40/NotoSansTC-Regular.ttf') format('truetype');
    }
* {font-family: 'Noto Sans TC', sans-serif;}
...
to template_css.php in the PDF template is working fine with Chinese characters
 
Thanks for your help.
Now solved. I changed to mpdf,and Modify ConfigVariables.php under mpdf/src/Config:

'autoScriptToLang' => true,

'autoLangToFont' => true,

(Default is false)

So mpdf support Chinese characters.
 
Glad you got it working.
Keep in mind that you have to do these changes after every Fabrik installation/update.

But it's also working with domPDF.

(I added the Chinese characters to the thread title).
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top