iFrame is not coming in screenshot - HTML2Canvas

有些话、适合烂在心里 提交于 2019-12-08 12:57:46

问题


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.


回答1:


It says in their documentation that iframes are not supported:

The script doesn't render plugin content such as Flash or Java applets. It doesn't render iframe content either. Blockquote



来源:https://stackoverflow.com/questions/36724178/iframe-is-not-coming-in-screenshot-html2canvas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!