1
0
-1

Hi,

We have a Joget DX On-Demand subscription and I am trying to use the "Export Form Email Tool" and having problems with Turkish characters in the PDF.

The Turkish characters such as ı, ğ, İ, ş are not shown in the PDF. For example at the fourth line the header "Adayn Doum Tarihi" should have been "Adayın Doğum Tarihi".  By the way we have no problem with Turkish characters in the application ( in the forms or datalists or with the "Print" option ).

These are the things I've tried:

1- To add utf-8 usage in the Header (HTML) of the "Export Form Email Tool" with these tags, with and without the choice of "tr", "tr-TR" as the System Settings => System Locale :
<meta charset="utf-8"/>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

2- To add the language choice in the Header (HTML):
<html lang="tr">

3- To use the font-face & font-family in the Formatting (CSS):

I've added the font files to the Resources in the Properties & Export part of the application. I've also tried to use the path as just like jw/web/app/iseAlimSureci_Dev/resources/ttimesb-webfont.eot too.

@font-face {

    font-family: 'turkish_times_new_roman';

    src: url('https://archeiktest.cloud.joget.com/jw/web/app/iseAlimSureci_Dev/resources/ttimesb-webfont.eot');

    src: url('https://archeiktest.cloud.joget.com/jw/web/app/iseAlimSureci_Dev/resources/ttimesb-webfont.eot?#iefix') format('embedded-opentype'),

         url('https://archeiktest.cloud.joget.com/jw/web/app/iseAlimSureci_Dev/resources/ttimesb-webfont.woff2') format('woff2'),

         url('https://archeiktest.cloud.joget.com/jw/web/app/iseAlimSureci_Dev/resources/ttimesb-webfont.woff') format('woff'),

         url('https://archeiktest.cloud.joget.com/jw/web/app/iseAlimSureci_Dev/resources/ttimesb-webfont.ttf') format('truetype'),

         url('https://archeiktest.cloud.joget.com/jw/web/app/iseAlimSureci_Dev/resources/ttimesb-webfont.svg#turkish_times_new_romanbold') format('svg');

    font-weight: bold;

    font-style: normal;

}

*{ font-family: 'turkish_times_new_roman', Arial, sans-serif; }

I would appreciate a lot if someone could direct me to a solution.

Thanks in advance,

    CommentAdd your comment...

    6 answers

    1.  
      3
      2
      1

      Thanks to Haldun Bayrak, the Turkish character problem in the PDF is solved. This is the code used in the Formatting (CSS) :

      Thank you too Chris, for your help. The font THSarabun worked after all (smile)


        CommentAdd your comment...
      1.  
        2
        1
        0

        We just solved the Problem by making some tests on our local Server. We would like to share our findings as follows.

        @font-face {
            -fs-pdf-font-embed: embed;
            -fs-pdf-font-encoding: Identity-H;
        }
        *{font-family: 'THSarabun';}

        is the correct CSS which works for us.
        The default path of fonts resist on jw/WEB-INF/classes/fonts/THSarabun/THSarabun.ttf
        so we don't need to define scr:url path for the file location.
        and the font-family Name must be identical with the ttf file name. (THSarabun)





          CommentAdd your comment...
        1.  
          1
          0
          -1

          Hi Cris, as Sebnem has mentioned she has a Cloud account and no access to Tomcat. The only way is to use Resources which should work for the same App only. But I'm not sure which font family can solve that issue.  @Joget Cloud Support Team may help and upload most recent ttf's.


            CommentAdd your comment...
          1.  
            1
            0
            -1

            Hi,

            Maybe the Turkish font problem for the PDF can be solved by adding the font to the font.csv file in the "/wflow/fonts" directory.  If I'm not mistaken, It's been suggested in the Export Form Email Tool#Advanced.

            Since we are using the Joget Cloud, how can I add a font to that font.csv file? Can I reach that directory? 

            Thanks in advance,


            1. Chris Angel

              Unfortunately since you are using Joget Cloud multi tenant, there is no way to access its directories or DB.

            CommentAdd your comment...
          2.  
            1
            0
            -1

            Hi Chris,

            Thank you for your answer. Sorry, I should have mentioned before that I have looked at the Export Form Email Tool#Advanced and tried that markup but it gave this error:

            "@font-face declaration doesn't follow the fontspring bulletproof syntax."

            So I have searched online for the syntax error and used this site to generate the font kit:

            https://www.fontsquirrel.com/tools/webfont-generator

            When I have used their font-face markup I did not get the error message.  As for your note; we have a subscription for cloud/on demand version of Joget hence we are not using Tomcat or any kind of server. That's why I have used the "Resources" in the Properties & Export on Joget to upload the font file.

            I think the font "TH Sarabun" is for Thai. You weren't suggesting to use that font, it was the example, wasn't it (smile)

            Sebnem

            1. Chris Angel

              Yes the "TH Sarabun" is just an example. (smile)

              Thanks for clarifying that you are using Joget Cloud so now I understand the workaround you are using.

              The lint warning you see above, after googling i find that it is just a warning to encourage you to add the same font family with all the different font format types to support all browser variants (e.g: IE, Chrome, Firefox, etc.). Unless you plan to support all browser variants, I think its ok to ignore the warning. I have no issue doing so.

              So after uploading my font file in the app "Resources", I did try your method with some modifications on my Joget Cloud instance and this seems to work. 
              Seems like it is just missing the font-family declaration.

              @font-face {
                  font-family: 'TH SarabunPSK';
                  src: url(#appResource.THSarabun.ttf#);
              }
              *{font-family: 'TH SarabunPSK';font-size: 20px;}

              Note: I tested this in the userview settings 'custom CSS' property just for ease of testing, haven't tried in the actual Export Form Email Tool. But it should work pretty similarly.

            2. Sebnem Kabadayi

              Thank you for your help, Chris.

              I've tested your suggestion, unfortunately it doesn't work in the "Export Form Email Tool"...

              It works in the userview though. So the font-face syntax is working there. I still can't change the font for the PDF.


            3. Chris Angel

              Pdf compared to userview requires additional codes to work.

              Does your code look like this sample snippet below?

              @font-face {
                  font-family: 'TH SarabunPSK';
                  src: url(#appResource.THSarabun.ttf#);
                  -fs-pdf-font-embed: embed;
                  -fs-pdf-font-encoding: Identity-H;
              }
              *{font-family: 'TH SarabunPSK';font-size: 20px;}
            4. Sebnem Kabadayi

              Yes, it's the same, apart from the font-size - I don't want to change the font size:

              I have tried some other fonts too, the font never changes.

              This code only changes the font-size, not the font:



            CommentAdd your comment...
          3.  
            1
            0
            -1

            Hi Sebnem,

            From the methods you've tried above, the CSS markup mentioned seems to be incorrect.

            Perhaps you can take a look at the guide here: Export Form Email Tool#Advanced. Specifically the 'method 1' or 'method 2' under the "Example for adding non supported font" section in the "Advanced → Formatting (CSS)" property.

            Here is a sample code snippet:

            @font-face {
                src: url(http://localhost:8080/THSarabun.ttf);
                -fs-pdf-font-embed: embed;
                -fs-pdf-font-encoding: Identity-H;
            }
            *{font-family: 'TH SarabunPSK';}

            NoteDownload the THSarabun.ttf font file and copy it to "[Tomcat Directory]/webapps/ROOT" folder.

            Hope this helps!

              CommentAdd your comment...