How to add pdf-pages while exporting chart?

Answered
Ravi asked on January 18, 2019

I am an licensed user and I have below question,
How to add pdf-pages while exporting chart as like grid. In grid, we usually add pages using callback handler. But in Chart, the same callback gives 'Uint8Array' from 'res.data' instead of 'pdf' object/instance.

Iam exporting multiple grid and chart in a single page. So, I should get that 'pdf' instance to add pages.

For this, I have shared a fiddle link below, please make your changes in button(Export To PDF) at top of the pivot grid.
https://jsfiddle.net/abufiddle/Lnajd6qv/1/

4 answers

Public
Tanya Gryshko Tanya Gryshko Flexmonster January 21, 2019

Hello, Ravi,
Thank you for reporting this issue. We were able to reproduce it on our side.
Our development team can add the fix for charts to be returned also as 'pdf' object/instance on February the 25th. Would it work for you?
Regards,
Tanya

Public
Iryna Kulchytska Iryna Kulchytska Flexmonster February 27, 2019

Hello Ravi,

I'm glad to inform you that the version with the fix has already been released.
Please feel free to update the component.

Let us know if everything works fine for you.

Kind regards,
Iryna

Public
Ravi July 2, 2019

Hi Tanya and Iryna,
Thanks for your support.
 
You are providing the ‘pdf’ instance inside the callback of 'exportTo()' method.
But also, we need this ‘pdf’ instance inside 'exportstart' event to add logo image, title, description, etc.,
For this, I have shared a fiddle link below,
https://jsfiddle.net/abufiddle/Lnajd6qv/5/
 
Note:
We already tried to add logo and all the stuffs inside 'exportTo()'  but it's just overlapping with the actual chart image.

Public
Vera Didenko Vera Didenko Flexmonster July 3, 2019

Hello, Ravi,
 
Thank you for your question.
 
We would like to bring to your attention that you can add logo image, title, description, etc. to the PDF export by specifying the header parameter:

flexmonster.exportTo("pdf", 
{
destinationType: "plain",
header: "<div> <img src='data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='/> Description: Hello world! </div>"
}, function(res) {
//Further code here
});

 
Here is a JSFiddle example for illustration.
 
 
Please let us know if such an approach works fine for your case.
 
Best Regards,
Vera

Please login or Register to Submit Answer