我试图打印生成的条形码,但它打印为对象,对象尝试使用JSON.stringify和所有其他来源,但不起作用。有人能建议一下做这件事最好的方法吗?
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html><head><title>DIV
Contents</title>');
printWindow.document.write('</head><body >');
for(var i=0; i<selectedRows.length;i++){
printWindow.document.write(
<Barcode
value="Rakesh"//{this.state.value}
width="2"
height="100"
format="CODE128"
displayValue=""
fontOptions=""
font="monospace"
textAlign="center"
textPosition="bottom"
textMargin="2"
fontSize="20"
background="#ffffff"
lineColor="#000000"
margin="10"
marginTop=""
marginBottom=""
marginLeft=""
marginRight=""
/>
);
}
printWindow.document.write('</body></html>');
printWindow.document.close();
// printWindow.print();https://stackoverflow.com/questions/47708955
复制相似问题