Posted: 21 Mar 2019 22:44 EDT Last activity: 19 Jul 2019 1:05 EDT
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.
***Edited by Moderator Marissa to update platform capability tags****
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.