我的屏幕分为两个画布顶部和底部.one是2D和另一个3D。现在我试图导出打印机。我在添加单页时获取了我的图像数据(twoDData
和threeDDate
),但我需要导出打印机第一页2D图像数据,第二页3D图像数据集。怎么做?
this.exportPrint = function(){
var twoDData = renderer2D.domElement.toDataURL('image/jpeg', 1.0);
var threeDData = renderer3D.domElement.toDataURL('image/jpeg', 1.0);
var printWin = window.open('','_blank','Print','top=0,left=100,height=600,width=600,toolbars=0,scrollbars=yes');
printWin.document.open();
printWin.document.write('<!DOCTYPE html>');
printWin.document.write('<html>');
printWin.document.write('<head><title>Construction</title></head>');
printWin.document.write('<body>');
printWin.document.write('<img src="' + twoDData +'" onload=window.print();window.close();/>'); //twoDData
printWin.document.write('<img src="' + threeDData +'" onload=window.print();window.close();/>'); //threeDData
printWin.document.write('</body>');
printWin.document.write('</html>');
printWin.document.close();
setInterval(function () {
printWin.focus();
printWin.print();
printWin.close();
}, 500);
};
如何在第二页设置twoDData
第一页,threeDData
?什么分页方法?