[Grid] Export Unicode text into PDF

1 Answer 20 Views
Grid PDFViewer
vahid
Top achievements
Rank 1
Iron
Iron
vahid asked on 29 Jul 2022, 04:11 PM

Hello,

kendo grid can't support unicode text in pdf sample

thank you

vahid
Top achievements
Rank 1
Iron
Iron
commented on 30 Jul 2022, 01:02 PM | edited

i read Unicode and Embedded Fonts and set persian font

kendo.pdf.defineFont({
  "DejaVu Sans": "https://kendo.cdn.telerik.com/2022.2.621/styles/fonts/DejaVu/DejaVuSans.ttf",
  "DejaVu Sans|Bold": "https://kendo.cdn.telerik.com/2022.2.621/styles/fonts/DejaVu/DejaVuSans-Bold.ttf",
  "DejaVu Sans|Bold|Italic": "https://kendo.cdn.telerik.com/2022.2.621/styles/fonts/DejaVu/DejaVuSans-Oblique.ttf",
  "DejaVu Sans|Italic": "https://kendo.cdn.telerik.com/2022.2.621/styles/fonts/DejaVu/DejaVuSans-Oblique.ttf",
  "WebComponentsIcons": "https://kendo.cdn.telerik.com/2022.2.621/styles/fonts/glyphs/WebComponentsIcons.ttf"
});

persian font

    kendo.pdf.defineFont({
        "IRANSansX Sans":"/css/Webfonts/fonts/IRANSansX-Regular.ttf",
        "IRANSansX Sans":"/css/Webfonts/fonts/woff/IRANSansX-Regular.woff",
        "IRANSansX Sans|Bold":"/css/Webfonts/fonts/woff/IRANSansX-Bold.woff",
        "IRANSansX Sans|Bold|Italic":"/css/Webfonts/fonts/woff/woff/IRANSansX-Regular.woff",
        "IRANSansX Sans|Italic":"/css/Webfonts/fonts/woff/woff/IRANSansX-Regular.woff",
    });

not work

1 Answer, 1 is accepted

Sort by
1
Nikolay
Telerik team
answered on 03 Aug 2022, 11:28 AM

Hello Vahid,

To make sure the elements that you are trying to export are using this font, specify font family: "DejaVu Sans" in their styles. Add the following CSS rule to the Grid page:

    <style>
      .k-widget {
        font-family: "DejaVu Sans";
      }
    </style>

Dojo: https://dojo.telerik.com/avOYONUM

Let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid PDFViewer
Asked by
vahid
Top achievements
Rank 1
Iron
Iron
Answers by
Nikolay
Telerik team
Share this question
or