0

我在 HTML5 中工作,我有两个用于保存图像的项目文件夹(一个用于 svg,一个用于 png)。当我尝试打印画布时,它只给了我一个 png 图像作为输出,而不是两者一起作为它的一个设计,它是两个图像(png 和 svg)的组合。我需要一些技术来实现它。以下是节选:

     function convertPNG()
    {

var dataUrl1 = canvas.toDataURL();
var ww = '<!DOCTYPE html>';
ww += '<html>'
ww += '<head><title>Print canvas</title></head>';
ww += '<body>'
ww += '<img style="margin-bottom:150px;" src="images/products/img1.png">';//I m taking a static image as img1,I also want to implement a dynamic link to render all the images
ww += '<img style="margin-left:-320px;" src="' + dataUrl1 + '" >';
ww += '</body>';
ww += '</html>';


 var printWin = window.open("",'width="100" height="100"');
  printWin.document.write(ww);
printWin.document.close();
window.location = canvas.toDataURL("image/png");
}
4

0 回答 0