I have tried many times for capturing iframe into screenshot using Html2Canvas. But not coming and except iFrame everything is coming.
I have one web page with bootstrap menu and simple iframe. I want to take full page screen on button click.
May i know what step i missing in code implementation.
<input type="button" id="btnCapture" value="Capture" />
<script>
$("#btnCapture").on("click", function () {
captureAndUpload();
});
function captureAndUpload() {
html2canvas(document.body, {
onrendered: function (canvas) {
$.ajax({
url: "@Html.Raw(Url.Action("Action", "Controller"))",
data: { 'capturedShot': canvas.toDataURL("image/png") },
type: "POST",
dataType: "json",
success: function (result) {
alert("ScreenCaptured");
},
error: function () {
alert("fail");
}
});
}
});
}
<script>
You're answer will appreciable.