I am attempting to use HTML2Canvas to create a canvas of an element on a webpage that is a container DIV with an image used as the page backgound with overlays of text elements and tables. Renders perfectly in HTML. When I check my code with a debugger the captured element shows the first child to be be the IMG and the last child the table which is correct. My HTML2Canvas creates a captured image on a popup window but the background image is missing from the capture.. only the text type of objects are in the displayed capture. The operative code is as follows: The imageDataURL is then the argmument of a src = statement to write to the popup. Any help is appreciated. BTW.. if I make my capture object only the image element the popup is blank so for whatever reason, the image is not rendering or whatever.
html2canvas(elementToCapture, {
width: elementToCapture.scrollWidth,
height: 1.2*elementToCapture.scrollHeight,useCORS: true }).then(function(canvas) {
imageDataUrl = canvas.toDataURL('imgage/png');
openImagePopup(imageDataUrl);
html2canvas(elementToCapture, {
width: elementToCapture.scrollWidth,
height: 1.2*elementToCapture.scrollHeight,useCORS: true }).then(function(canvas) {
imageDataUrl = canvas.toDataURL('imgage/png');
openImagePopup(imageDataUrl);