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

PDF-Report with Chart

3 Answers 43 Views
Drawing API
This is a migrated thread and some comments may be shown as answers.
Jens
Top achievements
Rank 1
Jens asked on 26 Jun 2015, 05:43 PM

Hi!

We're currently evaluating KendoUI and trying to build a little example app which consists of a PDF-Report. Is it possible to extract a rendered chart and insert it into a multipage PDF-Report? My PDF renders fines but the chart is missing in the PDF-Output (see attached files)

App structure (It's basically a print preview with PDF-Export):

- One browser window with 1 Chart 

- The User hits the report button (see report screenshot)

- A -new- window is opened and the Chart from the first window is inserted (via JQuery) into the DOM of the 2. window (which holds the report).

- A PDF is generated (see pdf screenshot).

 

Thanks in advanced.

Best regards,

Jens

 

 

 

3 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 30 Jun 2015, 03:54 PM
Hi,

I assume that you're taking the SVG output from the chart and move it to the new window. As opposed to running an actual instance there.

This is not a supported configuration, as the PDF export engine will not process inline SVG documents.
Normally, the chart widget will cooperate with the export routine, returning a Drawing API "visual tree" to be processed.

The solution is to host a normal chart instance in the output window.

Does this make sense?

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jens
Top achievements
Rank 1
answered on 02 Jul 2015, 03:40 PM

Hm yeah thanks. 

Is there a recommend way on how to draw the Chart into the report window? Is there a workaround (e.g. render to an image)?

 

Thanks & best regards,

Jens

0
T. Tsonev
Telerik team
answered on 06 Jul 2015, 08:43 AM
Hello,

Rendering to an image should work, but will obviously produce a raster image.
That might or might not be a problem depending on what you plan to do with the PDF. High-resolution prints will suffer for example.

The exportImage method should get you a Base64-encoded image that can be set as a source on a plain img element.

The only way to get the vector shapes in place is to have the live instance of the widget during export.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Drawing API
Asked by
Jens
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Jens
Top achievements
Rank 1
Share this question
or