Jimesh
Jimesh

Reputation: 529

Kendo UI for MVC: Export to Pdf not working

I am using @(Html.Kendo().Grid in my .cshtml page in mvc application. I want to export the contents of the grid in the form of a pdf.

I have tried following approaches:

1)

.ToolBar(tools => tools.Pdf())
        .Pdf(pdf => pdf
            .AllPages()
            .PaperSize("A4")
            .Margin("2cm", "1cm", "1cm", "1cm")
            .Landscape()
            .FileName("Kendo UI Grid Export.pdf")
        )
 $("#exportToPdf").click(function(e) {
        var grid = $("#CommentsGrid").data("kendoGrid");
        grid.saveAsPDF();
    });

In both the approaches I am facing the same problem i.e on clicking Export to pdf button I am able to see a stuck progress bar and my screen is freezed.

Please help me to get out of this situation. Thanking you in advance. Code sample is appreciated.

Upvotes: 1

Views: 1237

Answers (1)

Jimesh
Jimesh

Reputation: 529

I found the problem.

The DejaVu fonts which are must for default Export To Pdf were missing in my case. The expected default location of this font is supposed to be: Content/kendo/fonts/DejaVu

I just added DejaVu and the pdf is downloaded.

Upvotes: 2

Related Questions