blank pdf download at client end when user tries to download all charts of a page on a single button click

Hello Team,

I am using syncfusion ej2 charts.

In my angular web application on a page I have 7-9 charts of different types(pie chart, bar chart, line chart), there is a button on page level (Download pdf). 

when user click on this button Download pdf, whole page should convert into pdf and get downloaded on client end.

when I am trying to achive this, there no chart is there in pdf, blank pdf, downloaded at client end.
we are not make any server side call to download the pdf, beacuse we just want to convert the whole page into pdf and get download.


please help on that.


1 Reply

SB Swetha Babu Syncfusion Team August 8, 2022 02:33 PM UTC

Hi Hari,


Greetings from Syncfusion.


You can export the multiple charts in single page by passing the multiple chart objects in the export method of chart. We have prepared sample based on your requirement. Please check with below snippet and sample.


public onClick(e: Event): void {

        this.chart.exportModule.export("PDF", "Charts", PdfPageOrientation.Portrait, [this.chart, this.linechart, this.areachart, this.splinechart, this.stepchart]);

    }


Exported PDF : https://www.syncfusion.com/downloads/support/directtrac/general/pd/Charts1234152223.pdf


Sample : https://stackblitz.com/edit/angular-3nexp3-pb1kfg


UG : https://ej2.syncfusion.com/angular/documentation/chart/chart-print/#multiple-chart-export


Kindly revert us if you have any concerns.


Regards,

Swetha


Loader.
Up arrow icon