I have a powerbi report embedded to my webpage. What I need is to add an "export" button to my page and export the report to the PDF/PNG when the button is clicked send it to my backend, so I can mail it. How can I achieve this?
Tried libs that convert html to pdf but since is an iframe it won't load the content due to CORS.
Tried
var element = $('#reportContainer')[0];
var report = powerbi.get(element);
report.print()
But this will open the print page by the browser and, thus, I'm not able to get what has been generated.