0
我有一个打印条形码和isbn's书籍的文档,我的问题是它只打印页面上的一列。我想每页打印2列或3列(如果页面将支持那么多列)。我正在使用JavaScript来生成具有书名的条形码。这里是代码:打印多列中的条码
for (x=0;x<data.isbn.length;x++)
{
if (x == 5){
'<div class="page-break"></div>';
} else
first += '$("#'+indexGlobal+'").barcode("'+isbn[x]+'", "codabar",{barHeight:40, fontSize:30, output:"bmp"});';
second += '<div class="wrapper"><div id="'+indexGlobal+'"></div><div class="fullSKU">      '+isbn[x]+
'</div><br/><div class="title">'+title[x]+'</div></div>   ';
indexGlobal++;
}
}
});//end of ajax call
var barcode = window.open('','BarcodeWindow','width=400');
var html = '<html><head><title>Barcode</title><style type="text/css">'+
'.page-break{display:block; page-break-before:always; }'+
'body{width: 2in;}'+
'.wrapper{height: 1in;margin-left:10px;margin-top:5px;margin-right:5px;}'+
'.fullSKU{float: left;}'+
'.shortSKU{float: right;font-size:25px;font-weight:bold;}'+
'.title{float: left;}'+
'</style><script type="text/javascript"src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.js"></script><script type="text/javascript" src="../barcode/jquery-barcode.js"></script><script>$(document).ready(function() {'+first+'window.print();window.close();});</script></head><body>'+second+'</body></html>';
barcode.document.open();
barcode.document.write(html);
barcode.document.close();
任何建议有此打印在多个列?
生成的html看起来像什么? –
它打印带有本书标题的条形码,但只是在页面的一列中。为了节省纸张,我希望能够在多列中打印。 – Jim
这不是我问的问题...... HTML源代码是什么样的?描述它呈现的是毫无意义的。 –