So I want to generate my PowerBI dash to pdf on my website, and I show my powerBI dash by using iframe embed code like this :
I wrap the iframe code by :
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4" >
<h1 class="h3 mb-0 text-gray-800">Averagion Dashboard</h1>
<button onclick="generatePDF()" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm">
<i class="fas fa-download fa-sm text-white-50"></i> Generate Report</a>
</button>
</div>
here is the the header script :
here is the js file : function generatePDF(){ const element = document.getElementById("reporttt");
html2pdf()
.from(element)
.save();
}
when the button is clicked, the pdf file that downloaded are empty page, how can I resolve this ?