Question

Saving a screenshot of a model window in to service export directory

I wanted to save the screenshot of a modal window with section having charts rendered on lcik of a button. later i would like to send the screenshot image as email because we can not send a email if section with charts.

Please share ways how i can do saving ascreenshot or some how i can send the section with char as email body or attachment.

Thanks,

Ganesh

***Edited by Moderator Marissa to update platform capability tags****

Comments

Keep up to date on this post and subscribe to comments

July 18, 2019 - 1:52pm

Hi Ganesh,

It should be possible to capture an image of a chart using the same mechanism used internally by the platform for the "Save as image" feature on report definition charts, though it is complicated and does not solve your requirement of downloading the image to the client or including the whole form.
 
The JS rule pzPega_chart_export_fusionchart defines a function pega.report.fusionexport.svgToImage, which takes the ID of an <svg> element and returns an <input> element which contains a data URL representing the chart in PNG format.  You can append this input element to a form and submit it to the server, where you might be able to use the data URL in an img element in an email.  This process uses the canvg library, so you’ll need to include that JS file as well.