- Posts: 9
- Thank you received: 2
Wrong caracters in attachinvoice
3 years 2 months ago - 3 years 2 months ago #353624
by Bone
Wrong caracters in attachinvoice was created by Bone
-- Joomla version -- : 4.3.3
-- PHP version -- : 8.1.16
-- Browser(s) name and version -- : any browser
-- Error-message(debug-mod must be tuned on) -- : no errors
I use attachinvoice in polish. The polish specific characters are not display - there are question marks in place of them.
For example, in the default Layout, you have the example in attachments.
In the Corporate layout the first of the attachments is ok, the second one still wrong.
-- PHP version -- : 8.1.16
-- Browser(s) name and version -- : any browser
-- Error-message(debug-mod must be tuned on) -- : no errors
I use attachinvoice in polish. The polish specific characters are not display - there are question marks in place of them.
For example, in the default Layout, you have the example in attachments.
In the Corporate layout the first of the attachments is ok, the second one still wrong.
Last edit: 3 years 2 months ago by Bone.
The following user(s) said Thank You: ssnobben
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353629
by nicolas
Replied by nicolas on topic Wrong caracters in attachinvoice
Hi,
This means that the font used by the plugin to generate the PDF doesn't support the characters. You need to use another font in the settings of the plugin in the Joomla plugins manager.
This means that the font used by the plugin to generate the PDF doesn't support the characters. You need to use another font in the settings of the plugin in the Joomla plugins manager.
The following user(s) said Thank You: ssnobben
Please Log in or Create an account to join the conversation.
3 years 2 months ago - 3 years 2 months ago #353640
by Bone
Replied by Bone on topic Wrong caracters in attachinvoice
I will try to change it.
But, I expect that the default settings work in an acceptable way.
But, I expect that the default settings work in an acceptable way.
Last edit: 3 years 2 months ago by Bone.
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353644
by Bone
Replied by Bone on topic Wrong caracters in attachinvoice
I have tested it.
Unfortunately, the chosen font is NOT used for the footer. So in the footer all the time question marks
Unfortunately, the chosen font is NOT used for the footer. So in the footer all the time question marks
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353649
by nicolas
Replied by nicolas on topic Wrong caracters in attachinvoice
Hi,
Unfortunately, we didn't find a font which works for any UTF8 character and the library we use to convert the HTML of the invoice into a PDF doesn't provide that. We already added several fonts to improve the compatibility with some characters.
Regarding the issue with the footer, I was indeed able to reproduce the issue on my end. It's actually a bug which is in the library we're using to convert the HTML of the invoice into a PDF. It was reported years ago here:
github.com/spipu/html2pdf/pull/2
I've replied there with some indications to simply reproduce the problem. Hopefully, someone knowing the inner workings of the library can provide a long term solution.
In the mean time, what you can do is to open the file plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/config/tcpdf.config.php and change "helvetica" in the line:
to the font you've selected in the font setting of the plugin so that it will use the same one for the footer.
Unfortunately, we didn't find a font which works for any UTF8 character and the library we use to convert the HTML of the invoice into a PDF doesn't provide that. We already added several fonts to improve the compatibility with some characters.
Regarding the issue with the footer, I was indeed able to reproduce the issue on my end. It's actually a bug which is in the library we're using to convert the HTML of the invoice into a PDF. It was reported years ago here:
github.com/spipu/html2pdf/pull/2
I've replied there with some indications to simply reproduce the problem. Hopefully, someone knowing the inner workings of the library can provide a long term solution.
In the mean time, what you can do is to open the file plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/config/tcpdf.config.php and change "helvetica" in the line:
Code:
define('PDF_FONT_NAME_MAIN', 'helvetica');
The following user(s) said Thank You: ssnobben
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353667
by Bone
Replied by Bone on topic Wrong caracters in attachinvoice
This solution does not work in my case. In place of question marks, I have now empty spaces. In the main part there is everything ok.
Try, maybe on your site, set the footer to:
Zażółć gęślą jaźń
for testing multiple (polish) characters
Try, maybe on your site, set the footer to:
Zażółć gęślą jaźń
for testing multiple (polish) characters
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353669
by nicolas
Replied by nicolas on topic Wrong caracters in attachinvoice
I tried that, with the font "kozgopromedium" selected in the plugin and I'm able to get the footer to display after changing the code in the plugins/hikashop/attachinvoice/vendor/spipu/html2pdf/src/config/tcpdf.config.php file to use kozgopromedium
Can you make sure you did the modification for PDF_FONT_NAME_MAIN and not for PDF_FONT_NAME_DATA ?
Are you using the same font or another one ?
Can you make sure you did the modification for PDF_FONT_NAME_MAIN and not for PDF_FONT_NAME_DATA ?
Are you using the same font or another one ?
The following user(s) said Thank You: ssnobben
Please Log in or Create an account to join the conversation.
3 years 2 months ago #353677
by Bone
Replied by Bone on topic Wrong caracters in attachinvoice
Thank you. It works, but the text does not look well - additional spaces.
I will just edit your template and move the footer to an ordinary div
I will just edit your template and move the footer to an ordinary div
The following user(s) said Thank You: ssnobben
Please Log in or Create an account to join the conversation.
Time to create page: 0.149 seconds