Answers.Body: <p>I don't think it's the encoding it seems that none of the included fonts in dompdf support it. See also <a href="https://stackoverflow.com/questions/16384517/dompdf-character-encoding-utf-8">https://stackoverflow.com/questions/16384517/dompdf-character-encoding-utf-8</a>. If you look in the vendor/dompdf/dompdf/lib/fonts folder there's a readme about DejaVu, and it says you can get the font from <a href="http://code.google.com/p/dompdf" rel="nofollow noreferrer">http://code.google.com/p/dompdf</a> and copy it into your dompdf/lib/fonts folder. Then as the first link describes you need to change the font used by the Civi message template you're using, e.g. in the template under Administer - CiviMail - Message Templates if you edit the template you'll see either <code>&lt;font&gt;</code> tags or something like <code>style="font-family: Arial"</code>, and you can change the font there. If you're pdf'ing reports you can edit css/print.css.</p>
  
  <p><strong>Note that clicking the .ttf files at the link above</strong> seem to be redirects to another page where you can actually download the real file. If you just save the .ttf files directly they aren't really ttf files.</p>
  
  <p>Also in order to get it to recognize the .ttf I had to add this to the print.css file:</p>
  
  <pre><code>@font-face {
    font-family: 'DejaVu Sans';
    font-style: normal;
    font-weight: normal;
    src: url(https://mysite.org/path/to/civicrm/vendor/dompdf/dompdf/lib/fonts/DejaVuSans.ttf) format('truetype');
  }
  @font-face {
    font-family: 'DejaVu Sans';
    font-style: italic;
    font-weight: normal;
    src: url(https://mysite.org/path/to/civicrm/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-Oblique.ttf) format('truetype');
  }
  @font-face {
    font-family: 'DejaVu Sans';
    font-style: normal;
    font-weight: bold;
    src: url(https://mysite.org/path/to/civicrm/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-Bold.ttf) format('truetype');
  }
  @font-face {
    font-family: 'DejaVu Sans';
    font-style: italic;
    font-weight: bold;
    src: url(https://mysite.org/path/to/civicrm/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-BoldOblique.ttf) format('truetype');
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-19T21:21:29.023Z
Answers.Text: Hello.
  I tried to install the fonts in this folder, but they do not work.
  I found the fonts in ttf and then converted to afm, but it seems that in order to make them work, you need to make some additional settings.
  I went through all the fonts, saving them in the /administrator/components/com_civicrm/civicrm/css/print.css file
  It is in this file that I need to make edits so that the report files look correct.
  Tell me what am I doing wrong?
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-19T23:11:51.313Z
Answers.Text: You're right there seems to be something still missing.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T00:49:47.190Z
Answers.Text: I've updated answer.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T09:39:40.830Z
Answers.Text: Hello.
  Thanks for your help.
  Did exactly as you say, but nothing helps. The font is changing, but the Cyrillic characters are still displayed as question marks. I also tried to download fonts that support the Russian language here https://www.fonts-online.ru/font/Geometos-%5BRUS-by-Daymarius%5D, but never got the desired result. Is it possible to display Russian letters in PDF in this program?
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T10:44:00.267Z
Answers.Text: Yes it worked for me with russian letters. If you choose file - properties in the pdf and look at the fonts tab is it the right font?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T12:22:26.333Z
Answers.Text: Not. Shows a different font. I edited the post, and attached to it a screen of what the program shows.
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T13:02:33.080Z
Answers.Text: Is the url in @font-face correct for your site? If you put it into the browser bar does it download the ttf file?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T13:13:37.833Z
Answers.Text: Yes. Is loading. https://goo.gl/PYvQSL
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T13:51:45.870Z
Answers.Text: Some more things to check: 1. Earlier you said you converted to afm. Maybe move that file out of the way in case it is interfering. 2. If you choose "print report" instead of PDF, does it pick up the right styles when you check using your browser developer tools? 3. On the report page if you click on title and format, is the path to the print.css file correct in the @import tag (especially if on windows no backslashes).
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T15:20:35.840Z
Answers.Text: I understood what was the matter.
  It turns out I put the code in the wrong place in the /administrator/components/com_civicrm/civicrm/css/print.css file
  Now I fixed it, and the information is already better displayed in the file, but not everywhere. Part of the file is displayed correctly, but part is not. Probably still in some places still need to insert such a code?
  Can you look at the file itself?
  I edited the post, and attached the file to the post, as well as attached the pdf file, and the saved report for printing.
  Thanks you!
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T15:40:51.533Z
Answers.Text: Those are bold, which is the default for "th" tags even if not specified. So also install the bold .ttf and add a @font-face for that. Also technically there is a space between DejaVu and Sans, but it should work out ok as long as it's consistent.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T16:28:56.797Z
Answers.Text: Happened! Thank!
  But now the bold text is no longer bold, and the links to half crossed out. Can you please tell me how to fix this?
  Now I wrote everything in the code like this https://yadi.sk/i/a3LHb-Ih0UpJrQ
  And tell me how much to pay for your help? And where to pay?
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T17:25:06.300Z
Answers.Text: I'm not asking for money but thanks. If you really want you could donate something at civicrm.org or a charity. You have some overlap in the font family and url where you've got the same thing for different font-styles.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T21:06:53.877Z
Answers.Text: Thank!
  Do not quite understand. What kind of coincidence are you talking about?
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T23:06:17.833Z
Answers.Text: For example for the one where you have font-style=italic, you have duplicated "DejaVu Sans" and the url for it, instead of using "DejaVu Sans-Oblique" and "DejaVuSans-Oblique.ttf". In english Italic and Oblique mean the same thing for fonts (maybe not to a purist, but for most practical use).
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-21T15:35:04.967Z
Answers.Text: Hello.
  Now I did this: https://yadi.sk/i/xJhAiAHyyCgcfg
  But it still does not help.
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-24T14:41:30.437Z
Answers.Text: Hello.
  Do you know what I did wrong, or is it unclear why it does not work as it should?
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-25T20:25:47.847Z
Answers.Text: I've updated answer with a fuller list. Sorry the font-family stays the same but you need to get the right combination of font-weight and font-style to match the ttf file. Regarding half-crossed out links, I think that's just the way the spacing comes out, either because of the font or dompdf. You could also try any other ttf font that supports utf-8 characters, or you could try editing print.css to style links so that there is no underline i.e. a {text-decoration: none;}
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-28T16:20:03.650Z
Answers.Text: Hello.
  It still does not work to make bold and italic.
  Maybe let me give you access to the site, and you see why it does not work? And then write here information about it. Where to send access data?
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-04T03:37:45.260Z
Answers.Text: The above seems to be missing a closing brace in the second font-face definition. I must have copy-pasted wrong. Sorry about that. I've updated answer.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-07T17:49:04.990Z
Answers.Text: Hello. I immediately noticed the problem with the latching bracket, and corrected it. It's not about her.
Answers.UserDisplayName: Вася Пупкин
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-17T17:36:36.757Z
Answers.LastActivityDate: 2019-01-04T03:38:17.900Z
Answers.LastEditDate: 2019-01-04T03:38:17.900Z
Answers.UserDisplayName: Demerit
Body: <p>How to change the encoding in pdf documents?
  Cyrillic characters are not displayed in my pdf documents.
  To display them, you need to change the encoding. Please tell me which file can this be done?
  I tried to find the answer in other questions, but unfortunately I could not.</p>
  
  <p><a href="https://i.sstatic.net/kiyNY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kiyNY.png" alt="enter image description here"></a></p>
  
  <p><a href="https://yadi.sk/d/YidAHxm-TAWqYw" rel="nofollow noreferrer">css</a></p>
  
  <p><a href="https://yadi.sk/d/ujUEdexBNWkgcg" rel="nofollow noreferrer">Report pdf</a></p>
  
  <p><a href="https://yadi.sk/d/p2VNIZIsQtWOmQ" rel="nofollow noreferrer">Report html</a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-24T03:56:39.067Z
Comments.Text: This needs to be fixed in CiviCRM
Comments.UserDisplayName: Vietyank
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-10-16T13:47:38.590Z
Comments.Text: This has been raised as an issue https://lab.civicrm.org/dev/core/-/issues/2126
Comments.UserDisplayName: William Mortada
Tags: <joomla><pdf>
Title: How to change the encoding in pdf documents?
ThreadText: # How to change the encoding in pdf documents?
  
  (Asked by: username_0 on 2018-12-16)
  
  How to change the encoding in pdf documents?
  Cyrillic characters are not displayed in my pdf documents.
  To display them, you need to change the encoding. Please tell me which file can this be done?
  I tried to find the answer in other questions, but unfortunately I could not.
  
  [![enter image description here](https://i.sstatic.net/kiyNY.png)](https://i.sstatic.net/kiyNY.png)
  
  [css](https://yadi.sk/d/YidAHxm-TAWqYw)
  
  [Report pdf](https://yadi.sk/d/ujUEdexBNWkgcg)
  
  [Report html](https://yadi.sk/d/p2VNIZIsQtWOmQ)
  
  **Tags:** joomla, pdf
  
  > **Comments:**
  > **username_1**: This needs to be fixed in CiviCRM  
  > **username_2**: This has been raised as an issue https://lab.civicrm.org/dev/core/-/issues/2126  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2018-12-17. Score: 7 | Accepted answer
  
  I don't think it's the encoding it seems that none of the included fonts in dompdf support it. See also https://stackoverflow.com/questions/16384517/dompdf-character-encoding-utf-8. If you look in the vendor/dompdf/dompdf/lib/fonts folder there's a readme about DejaVu, and it says you can get the font from http://code.google.com/p/dompdf and copy it into your dompdf/lib/fonts folder. Then as the first link describes you need to change the font used by the Civi message template you're using, e.g. in the template under Administer - CiviMail - Message Templates if you edit the template you'll see either  tags or something like style="font-family: Arial", and you can change the font there. If you're pdf'ing reports you can edit css/print.css.
  Note that clicking the .ttf files at the link above seem to be redirects to another page where you can actually download the real file. If you just save the .ttf files directly they aren't really ttf files.
  Also in order to get it to recognize the .ttf I had to add this to the print.css file:
  @font-face {
    font-family: 'DejaVu Sans';
    font-style: normal;
    font-weight: normal;
    src: url(https://mysite.org/path/to/civicrm/vendor/dompdf/dompdf/lib/fonts/DejaVuSans.ttf) format('truetype');
  }
  @font-face {
    font-family: 'DejaVu Sans';
    font-style: italic;
    font-weight: normal;
    src: url(https://mysite.org/path/to/civicrm/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-Oblique.ttf) format('truetype');
  }
  @font-face {
    font-family: 'DejaVu Sans';
    font-style: normal;
    font-weight: bold;
    src: url(https://mysite.org/path/to/civicrm/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-Bold.ttf) format('truetype');
  }
  @font-face {
    font-family: 'DejaVu Sans';
    font-style: italic;
    font-weight: bold;
    src: url(https://mysite.org/path/to/civicrm/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-BoldOblique.ttf) format('truetype');
  }
  
  > **Comments:**
  > **username_0**: Hello. I tried to install the fonts in this folder, but they do not work. I found the fonts in ttf and then converted to afm, but it seems that in order to make them work, you need to make some additional settings. I went through all the fonts, saving them in the /administrator/components/com_civicrm/civicrm/css/print.css file It is in this file that I need to make edits so that the report files look correct. Tell me what am I doing wrong?  
  > **username_3**: You're right there seems to be something still missing.  
  > **username_3**: I've updated answer.  
  > **username_0**: Hello. Thanks for your help. Did exactly as you say, but nothing helps. The font is changing, but the Cyrillic characters are still displayed as question marks. I also tried to download fonts that support the Russian language here https://www.fonts-online.ru/font/Geometos-%5BRUS-by-Daymarius%5D, but never got the desired result. Is it possible to display Russian letters in PDF in this program?  
  > **username_3**: Yes it worked for me with russian letters. If you choose file - properties in the pdf and look at the fonts tab is it the right font?  
  > **username_0**: Not. Shows a different font. I edited the post, and attached to it a screen of what the program shows.  
  > **username_3**: Is the url in @font-face correct for your site? If you put it into the browser bar does it download the ttf file?  
  > **username_0**: Yes. Is loading. https://goo.gl/PYvQSL  
  > **username_3**: Some more things to check: 1. Earlier you said you converted to afm. Maybe move that file out of the way in case it is interfering. 2. If you choose "print report" instead of PDF, does it pick up the right styles when you check using your browser developer tools? 3. On the report page if you click on title and format, is the path to the print.css file correct in the @import tag (especially if on windows no backslashes).  
  > **username_0**: I understood what was the matter. It turns out I put the code in the wrong place in the /administrator/components/com_civicrm/civicrm/css/print.css file Now I fixed it, and the information is already better displayed in the file, but not everywhere. Part of the file is displayed correctly, but part is not. Probably still in some places still need to insert such a code? Can you look at the file itself? I edited the post, and attached the file to the post, as well as attached the pdf file, and the saved report for printing. Thanks you!  
  > **username_3**: Those are bold, which is the default for "th" tags even if not specified. So also install the bold .ttf and add a @font-face for that. Also technically there is a space between DejaVu and Sans, but it should work out ok as long as it's consistent.  
  > **username_0**: Happened! Thank! But now the bold text is no longer bold, and the links to half crossed out. Can you please tell me how to fix this? Now I wrote everything in the code like this https://yadi.sk/i/a3LHb-Ih0UpJrQ And tell me how much to pay for your help? And where to pay?  
  > **username_3**: I'm not asking for money but thanks. If you really want you could donate something at civicrm.org or a charity. You have some overlap in the font family and url where you've got the same thing for different font-styles.  
  > **username_0**: Thank! Do not quite understand. What kind of coincidence are you talking about?  
  > **username_3**: For example for the one where you have font-style=italic, you have duplicated "DejaVu Sans" and the url for it, instead of using "DejaVu Sans-Oblique" and "DejaVuSans-Oblique.ttf". In english Italic and Oblique mean the same thing for fonts (maybe not to a purist, but for most practical use).  
  > **username_0**: Hello. Now I did this: https://yadi.sk/i/xJhAiAHyyCgcfg But it still does not help.  
  > **username_0**: Hello. Do you know what I did wrong, or is it unclear why it does not work as it should?  
  > **username_3**: I've updated answer with a fuller list. Sorry the font-family stays the same but you need to get the right combination of font-weight and font-style to match the ttf file. Regarding half-crossed out links, I think that's just the way the spacing comes out, either because of the font or dompdf. You could also try any other ttf font that supports utf-8 characters, or you could try editing print.css to style links so that there is no underline i.e. a {text-decoration: none;}  
  > **username_0**: Hello. It still does not work to make bold and italic. Maybe let me give you access to the site, and you see why it does not work? And then write here information about it. Where to send access data?  
  > **username_3**: The above seems to be missing a closing brace in the second font-face definition. I must have copy-pasted wrong. Sorry about that. I've updated answer.  
  > **username_0**: Hello. I immediately noticed the problem with the latching bracket, and corrected it. It's not about her.  
  
  ---
  
  