Export to PDF for MVC Diagram does not work

2 posts, 0 answers
  1. Sanjukta
    Sanjukta avatar
    14 posts
    Member since:
    Jul 2018

    Posted 23 Aug 2018 Link to this post

    Hi Team,

          I was trying to export the diagram to pdf, but it shows error.

    Please help.

    Razor Code :

    @using Kendo.Mvc.UI<br>@{<br>    ViewBag.Title = "Workflow Chart";<br>}
    <p><br><script src="https://kendo.cdn.telerik.com/2017.3.913/js/pako_deflate.min.js"></script></p><p><button class="btn btn-primary" id="btnExportPdf">Export to PDF</button></p><p>@(Html.Kendo().Diagram()<br>                            .Name("workflowOverviewDiagram")<br>                            .Pdf(pdf => pdf<br>              .FileName("KendoUIDiagramExport.pdf")<br>              .ProxyURL(Url.Action("Pdf_Export_Save", "WorkflowMaintenance", new { area = "Maintenance"}))<br>          )<br>                            .DataSource(dataSource => dataSource<br>                            .Read(read => read.Action("GetWorkflowStopData", "WorkflowMaintenance", new { area = "Maintenance", workflowDefinitionId = Model.OtcId }))<br>                            .Model(m => m.Children("Items"))<br>                            )<br>                            .Editable(false)<br>                            .Layout(l => l<br>                                        .HorizontalSeparation(400)<br>                                        .VerticalSeparation(200)<br>                                        .Type(DiagramLayoutType.Tree).Subtype(DiagramLayoutSubtype.Down)<br>                            )<br>                            .ShapeDefaults(sd => sd.Visual("visualTemplate"))<br>                            .ConnectionDefaults(cd => cd<br>                                .EndCap("ArrowEnd")<br>                                .Stroke(s => s<br>                                .Color("#979797")<br>                            )<br>                            )<br>                            .ZoomRate(0)<br>                            .Selectable(false)<br>                            .Events(events => events.DataBound("onDataBound"))<br><br>)</p><p><script></p><p>$("#btnExportPdf").click(function () {<br>        $("#workflowOverviewDiagram").getKendoDiagram().saveAsPDF();<br>    });</p><p></script></p>

    Error :

    kendo.all.js:52580 Uncaught Error: Cannot output NaN to PDF
        at e (VM4745 kendo.all.min.js:52)
        at VM4745 kendo.all.min.js:52
        at Function.e.withIndent (VM4745 kendo.all.min.js:52)
        at D (VM4745 kendo.all.min.js:52)
        at e (VM4745 kendo.all.min.js:52)
        at Function.e.indent (VM4745 kendo.all.min.js:52)
        at VM4745 kendo.all.min.js:53
        at Function.e.withIndent (VM4745 kendo.all.min.js:52)
        at z.render.render (VM4745 kendo.all.min.js:53)
        at e (VM4745 kendo.all.min.js:52)



  2. Milena
    Milena avatar
    257 posts

    Posted 28 Aug 2018 Link to this post


    I tried to replicate the unwanted behavior using the provided setup, but to no avail. Can you reproduce the same problem on our online example? In case some specific configuration is needed, please modify it or isolate a small runnable project, which demonstrates the issue. 

    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top