We a requirement to download a PDF which includes graph/chart. On click on button, we execute a utility which will call HTMLtoPDF activity to generate and download PDF file. We have a requirement now to include a chart inside in this PDF.
@RUKNUDDINM There is no Out of the Box(OOTB) functionality available to include a Chart image in a custom section and export that section to PDF as a whole. The product does not support it.
When charts are rendered on browser, byte-code of the chart is copied from browser using a third party library canvg and later embedded into the PDF. This does not work when chart is included in a section and using HTMLtoPDF activity to export the whole section along with the chart because HTMLtoPDF uses pd4ml library.
You can try to include pyEmbedChartUsingPhantomJS HTML Fragment in your section. It seems this converts the image bytecode which will then be appended to PDF stream. Alternatively create data base view (it will solve multiple class reference issue) and connect the view with report definition. Use the report definition export option.
The above local change is only applicable for charts sourced from Report Definition and is implemented as mentioned in the following link:
If its a JS based chart, export to pdf of charts are not supported. js based fusion chart wont render in pdf generation as there is no chart markup generated on server.
See:
Note that Enhancement FDBK-72382 exists for future consideration where Pega Chart sourced from DT would get exported to PDF.
@MarijeSchillern we have achieved it using svg tags inside html. We had to generate graphs using svg tags which took good amount of time but the charts came out well. Thanks
@AJAYS I can see that user @RUKNUDDINM has not logged in for a while, and as this is a closed thread you may want to log your question as a New Question.
Did you already see the other available resources?