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)