View PDF Report doesn't show cyrillic and latin accented characters

Phoca Cart - complex e-commerce extension
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 389
Joined: 07 Nov 2018, 14:55

View PDF Report doesn't show cyrillic and latin accented characters

Post by Nidzo »

How and what to change to PDF Report display cyrillic and latin accented characters correctly? HTML view is displayed OK. I use Phoca PDF and Invoices and orders are displayed OK too.
Also how can I change time/date format to dd.mm.YYYY in Report?
Thanks!

Image
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: View PDF Report doesn't show cyrillic and latin accented characters

Post by Jan »

Hi, it depends on used PDF font in Phoca PDF. You need to install font which includes cyrillic characters.

Try to see some of the following fonts:
https://www.phoca.cz/download/category/ ... apdf-fonts (Dejavu fonts should include a lot of different national characters, so maybe this font should help)

The report has own layout which can be overrided by template:
administrator/components/com_phocacart/layouts/report.php

so you can cutomize the date for you there.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 389
Joined: 07 Nov 2018, 14:55

Re: View PDF Report doesn't show cyrillic and latin accented characters

Post by Nidzo »

Unfortunately, I was unable to change the date. It becomes frustrating.

When I change $format = '%Y-%m-%d'; to any other value I get error
An error has occurred.
500 Incorrect DATE value: '11-01-2023'

Code: Select all

error - Uncaught Throwable of type Exception thrown with message "Incorrect DATE value: '21-12-2022'". Stack trace: #0 [ROOT]\libraries\src\MVC\Controller\BaseController.php(639): PhocaCartCpViewPhocacartReports->display() #1 [ROOT]\administrator\components\com_phocacart\controller.php(91): Joomla\CMS\MVC\Controller\BaseController->display(false, Array) #2 [ROOT]\libraries\src\MVC\Controller\BaseController.php(672): phocaCartCpController->display() #3 [ROOT]\administrator\components\com_phocacart\phocacart.php(25): Joomla\CMS\MVC\Controller\BaseController->execute('') #4 [ROOT]\libraries\src\Dispatcher\LegacyComponentDispatcher.php(71): require_once('C:\\wamp64\\www\\z...') #5 [ROOT]\libraries\src\Dispatcher\LegacyComponentDispatcher.php(73): Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}('C:\\wamp64\\www\\z...') #6 [ROOT]\libraries\src\Component\ComponentHelper.php(355): Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() #7 [ROOT]\libraries\src\Application\AdministratorApplication.php(143): Joomla\CMS\Component\ComponentHelper::renderComponent('com_phocacart') #8 [ROOT]\libraries\src\Application\AdministratorApplication.php(186): Joomla\CMS\Application\AdministratorApplication->dispatch() #9 [ROOT]\libraries\src\Application\CMSApplication.php(294): Joomla\CMS\Application\AdministratorApplication->doExecute() #10 [ROOT]\administrator\includes\app.php(61): Joomla\CMS\Application\CMSApplication->execute() #11 [ROOT]\administrator\index.php(32): require_once('C:\\wamp64\\www\\z...') #12 {main}

I was also unable to solve the problem with Cyrillic and Latin accented letters too. I tried various fonts that Phoca Cart offers, but the problem only occurs in Reports. Invoices and orders are displayed OK
I would appreciate the help!

Joomla 4.2.7
Phoca Cart 4.0.5 and 4.0.6Beta13
PHP 8.1
jpeters
Phoca Professional
Phoca Professional
Posts: 225
Joined: 31 Dec 2020, 09:46

Re: View PDF Report doesn't show cyrillic and latin accented characters

Post by jpeters »

its not only font but also caracter set depended.
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 389
Joined: 07 Nov 2018, 14:55

Re: View PDF Report doesn't show cyrillic and latin accented characters

Post by Nidzo »

It occurred to me but I don't know how to change it.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: View PDF Report doesn't show cyrillic and latin accented characters

Post by Jan »

Hi, can you paste the screenshot of the error, I see trace but I don't see the first error file and its line.

The PDF creating is the same for all - invoices or reports, Can you send me some text and font you are using, so I can test it.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 389
Joined: 07 Nov 2018, 14:55

Re: View PDF Report doesn't show cyrillic and latin accented characters

Post by Nidzo »

DATE FORMAT

Cahnged to %d-%m-%Y

Image
Image

Default format %Y-%m-%d

Image


ACCENTED CHARACTERS IN PDF REPORT

Fonts for Phoca PDF I tried are Dejavu Sans, Free Mono, Free Sans, Helvetica.
Joomla Administration font is Joomla default.

Example:
Đorđe Šačević (latin with accented characters)
Петар Петровић (cyrillic characters)

Image
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: View PDF Report doesn't show cyrillic and latin accented characters

Post by Jan »

Hi,

1) the date format deprecated is Joomla core problem - here described:
https://github.com/joomla/joomla-cms/issues/38276
So still not solved, under review, we will see which solution will be selected

2) Characters in PDF
Try to install 4.0.6 Beta 15:
https://github.com/PhocaCz/PhocaCart/re ... Beta15.zip

It should be OK there (tested with Dejavusans font):
Image

Jan
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 389
Joined: 07 Nov 2018, 14:55

Re: View PDF Report doesn't show cyrillic and latin accented characters

Post by Nidzo »

1. O.K.

2. There is no more problem with characters in 4.0.6 Beta 15. Great job Jan!
Just curious. What caused the problem?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: View PDF Report doesn't show cyrillic and latin accented characters

Post by Jan »

Hi,
obsolete code in style, for the report, there was in style defined "font-family: arial" which got the pripority before setting the font in Phoca PDF. This is why the characters worked well in other PDFs but not in the report.
If you find Phoca extensions useful, please support the project
Post Reply