html2canvas give blank
Question
i want to export the disposition to an image, but give me blank image.
var div = document.querySelector('#wrapper');
html2canvas(div, {
onrendered: function (canvas) {
var screanshot = canvas.toDataURL("image/png");
}
});
thanks.Answers (3)
I advise you to ask the question under the html2canvas tag on StackOverflow. This is not really an issue with grapesjs. Also check wether your document.querySelector returns null. I think you are not using the iframe document.
@alibouaziz the #wrapper is inside the GrapesJS's iframe, so querySelector returns nothing.
You can access the content of the iframe via Canvas module, so to get the body you would do editor.Canvas.getBody()
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1887
Get JSON of specific gjs-data-type
I want to export JSON of only a specific gjs-data-type="img" I'm trying this but it doesn't give any result:
Issue #1822
[QUESTION] - Add style sector for specific Css rule
Hey @artf , COuld you give your help on this one? I want to disable the user to able to select the wrapper block (body) but I still want to...
Issue #716
Not allow selective Image resize
I do not want user to resize image on specific area of template, but want to allow anywhere on canvas. I want user to just choose image and...
Issue #1534
Update property Input value from model style.
@artf I want to update height of the element and want to give a custom height using following code It's working fine and it's update the se...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.