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

How to export to PDF in Angular

3 Answers 74 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Jhony
Top achievements
Rank 1
Jhony asked on 25 Jul 2017, 08:10 PM

Hello,

How can i do to export to PDF in angular 4 ?

I didn't find the documentation.

 

Thank you!

3 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 27 Jul 2017, 11:06 AM
Hello Jhony,

Please check out the following sections of our documentation for a detailed explanation and demos on exporting drawings to PDF and creating drawings out of HTML elements by utilizing the Kendo UI Drawing package:

http://www.telerik.com/kendo-angular-ui/components/drawing/pdf-output/

http://www.telerik.com/kendo-angular-ui/components/drawing/drawing-dom/

PDF export is also a built-in functionality of the Kendo UI Grid and Charts. Further information is available in the following sections:

http://www.telerik.com/kendo-angular-ui/components/grid/pdf-export/

http://www.telerik.com/kendo-angular-ui/components/charts/chart/export-options/#toc-exporting-to-pdf

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jyo
Top achievements
Rank 1
answered on 22 Feb 2021, 02:58 PM

How can i use kendo to export highcharts into pdf?

I want to use highcharts to make chart and then wanna convert into pdf.. is there any way to use kendo UI for this without using chart component of kendo ???

kindly response.

0
Dimiter Topalov
Telerik team
answered on 24 Feb 2021, 08:03 AM

Hi Jyo,

Exporting SVG elements to PDF is not supported. This is a documented limitation of the PDF export functionality:

https://www.telerik.com/kendo-angular-ui/components/drawing/limitations-browser-support/#toc-elements-and-styles

I see that the question is whether it is possible to export a third-party chart using the Kendo UI PDF export, but such functionality is not available due to the limitation, described above. Thus, the most straight-forward approach to export a chart to PDF will be using the Kendo UI for Angular Charts that provide PDF export as a built-in feature:

https://www.telerik.com/kendo-angular-ui/components/charts/

https://www.telerik.com/kendo-angular-ui/components/charts/chart/export-options/#toc-exporting-to-pdf

As for exporting a custom or third-party chart to PDF, there are a couple of possible approaches for a custom implementation that might yield the desired result:

- Use the Drawing library primitives to draw what needs to be exported (this is what the Kendo UI for Angular Charts do internally):

https://www.telerik.com/kendo-angular-ui/components/drawing/

To export the custom chart, it needs a custom exportVisual or similar method defined that returns a Group with everything to be drawn inside. In other words all chart elements need to be drawn with the Drawing API so that the result can be successfully exported.

- Alternatively the SVG Chart can be somehow (via a third-party library or custom logic) be converted to Canvas, and the canvas then can be exported to PDF.

We do not recommend any third-party library explicitly, but the following one seems to be providing the desired functionality:

https://github.com/canvg/canvg

Alternatively, the developer can utilize the Chrome and FireFox capabilities regarding drawing canvas based on SVG image (not supported in Edge and IE):

https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage#Browser_compatibility

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Charts
Asked by
Jhony
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Jyo
Top achievements
Rank 1
Share this question
or