This is a migrated thread and some comments may be shown as answers.

PDFExport .save does not pass special characters to pdf

2 Answers 1121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 08 Oct 2019, 08:05 AM

Trying to create a form with preview of what should be exported as pdf. Great tools, but I have an issue:

Adding the special characters "åäö" will render fine i the react component <Preview /> but not show in the pdf. I think they are replaced with whitespaces as of now. This code is part of the React component:

 

<PDFExport

    paperSize={"a4"}

    fileName="sample.pdf"

    title=""

    subject=""

    keywords=""

    ref={r => (toBeExportedAsPdf = r)}

>
    <Preview
         props={this.state.someString}
    />
</PDFExport>

 

Is there a fix for this avaliable? Thanks!

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 08 Oct 2019, 08:56 AM

Hello, Simon,

Thank you for the details.

This will require the use of custom fonts that support special characters. More details can be founded here:

https://www.telerik.com/kendo-react-ui/components/drawing/pdf-output/embedded-fonts/

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Simon
Top achievements
Rank 1
answered on 08 Oct 2019, 11:31 AM

Hi Stefan.

Thank you for a swift response. I actually already had some custom fonts in place, but after going through the link you sent me I realized that i was using woff2 format only. By adding truetype my problem was solved.

Thank you!

Sami
Top achievements
Rank 2
Iron
Iron
Iron
commented on 03 Jan 2023, 05:34 PM

Hi  simon, how  do you add truetype to your project?
Konstantin Dikov
Telerik team
commented on 05 Jan 2023, 07:40 AM

You should add the fonts with @font-face:

    @font-face {
        font-family: "DejaVu Sans";
        src: url("https://kendo.cdn.telerik.com/2017.2.621/styles/fonts/DejaVu/DejaVuSans.ttf") format("truetype");
    }

More on this topic can be found in the following article:

 

 

Tags
General Discussions
Asked by
Simon
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Simon
Top achievements
Rank 1
Share this question
or