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

PDF export, fonts squished together

2 Answers 336 Views
Drawing API
This is a migrated thread and some comments may be shown as answers.
Jussi
Top achievements
Rank 1
Jussi asked on 24 Nov 2016, 07:38 PM

We are generating a PDF form in Finnish language. We are having problems with scandic letters (åäö) not rendering correctly in the PDF. They are on top of each other. Is this a problem with Telerik PDF export or the font? Are there workarounds? I tried another font (Fira Sans) and the results are the same.

The attached files show how it looks in the DOM and in the generated PDF.

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 28 Nov 2016, 09:00 AM
Hi Jussi,

I tried to reproduce the reported letter squishing problem, but to no avail. I've made a test page http://dojo.telerik.com/@RumenJ/eKoJo (based on this demo) where I placed the word läkäärin on three different places and it was exported without problem with the DejaVu Sans font. Here is a screenshot of the result: http://screencast.com/t/BbPj6LxdpZp.

Best regards,
Rumen
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
Jussi
Top achievements
Rank 1
answered on 28 Nov 2016, 09:31 AM

Thanks for your test! I found the difference between my code and your example. You can see the overlapping characters behavior by commenting out these lines from your example:

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

 

There was a mistake with how I embedded fonts in our code. Using these exact lines fixes the problem for us. Ultimately, we will want to use "Fira Sans" font for our reports, so I just have to figure out how to use those fonts instead of "DejaVu Sans".

Tags
Drawing API
Asked by
Jussi
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Jussi
Top achievements
Rank 1
Share this question
or