Export to PDF Spanish accent

2 posts, 0 answers
  1. david
    david avatar
    1 posts
    Member since:
    Oct 2013

    Posted 12 Feb 2015 Link to this post

    Hi there,

    We are using Kendo Charts in our application. We can successfully export the charts using the following jQuery.

     var chart = $("#" + idChart).getKendoChart();
            chart.exportPDF({ paperSize: "auto", margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" } }).done(function (data) {
                kendo.saveAs({
                    dataURI: data,
                    fileName: "chart.pdf",
                    proxyURL: "@Url.Action("Export_Save", "Home")"
                });
            });

    But spanish accents are not rendering properly in the output PDF. Is there any configuration to be set?

    Thank you.
  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 12 Feb 2015 Link to this post

    Hi David,

    I replied to the same question in your other thread, however here is my answer too:

    In order to get everything correctly rendered you should import "DejaVu Sans" font for embedding: 
    <script>
        // Import DejaVu Sans font for embedding
       
        // NOTE: Only required if the Kendo UI stylesheets are loaded
        // from a different origin, e.g. cdn.kendostatic.com
        kendo.pdf.defineFont({
            "DejaVu Sans"             : "http://cdn.kendostatic.com/2014.3.1314/styles/fonts/DejaVu/DejaVuSans.ttf",
            "DejaVu Sans|Bold"        : "http://cdn.kendostatic.com/2014.3.1314/styles/fonts/DejaVu/DejaVuSans-Bold.ttf",
        });
    </script>
    and set "DejaVu Sans" font to the chart title, labels etc. For your convenience I prepared a basic example - please check it and let me know if this information helps or I can assist you further. I wish you a great day!

    Regards,
    Iliana Nikolova
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top