从 Printer.getGraphicsUtil 发出 printImage 命令时,如何阻止 Zebra 打印机 RW 420 自动送入大量额外纸张?
我在 android 项目中使用 zebra RW420,并且正在编码,我发现即使只是使用 ZSDK 开发人员演示测试打印机,当发出打印命令时,打印机也会打印大量额外的纸张。在本例中,我正在测试签名捕获和打印演示。我确实发现,如果我将其连接到计算机并打印使用 Zebra Designer 创建的标签,它会正确打印标签,而无需额外的纸张(事实上,在这种情况下,我不介意多打印几毫米)。
如果有人知道如何拯救这里的一些树木,那就太好了!
有问题的代码是:
connection.open();
ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);
GraphicsUtil g = printer.getGraphicsUtil();
Bitmap image = signatureArea.getBitmap();
g.printImage(image, 0, 0, image.getWidth(), image.getHeight(), false);
connection.close();
I am using a zebra RW420 in an android project and I am coding and I find that even when simply testing the printer using the ZSDK Developer Demos the printer is printing lots of extra paper when it is issued a print command. In this case I am testing out the signature capture and print demo. I do find that if I connect it to the computer and print a label created using Zebra Designer it prints the label properly with no extra paper (in fact i wouldn't mind a couple of millimeters extra in that case).
If any one knows how to save some trees here that would be great!
The code in question is:
connection.open();
ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);
GraphicsUtil g = printer.getGraphicsUtil();
Bitmap image = signatureArea.getBitmap();
g.printImage(image, 0, 0, image.getWidth(), image.getHeight(), false);
connection.close();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对我来说非常适合:
这不会浪费纸张,并且会打印到可用的文本/数据
假设您必须打印宽度 800 和高度 1200 的收据,但它正在打印高度约为 1200 的收据。 1800 。因此,浪费了 600 px 空白的收据,以利用您可以使用上面的代码的浪费。
this works perfect for me:
This wont waste paper and it will print upto the availability of text/data
Assume that you have to print a receipt of width 800 and height 1200 , but it is printing a receipt of height approx. 1800 . so there is a wastage of a receipt for 600 px of white space to make use of that wastage you can use above code.
您的 CPCL 标签中是否有关键字“
FORM
”?通常在 PRINT 之前这告诉打印机在打印到打印机配置的页顶设置后换页。要禁用它,如果不需要,可以从格式中删除
FORM
关键字,或者可以将top-of-form
设置为 0。将显示您的表单顶部当前设置的内容
会将其设置为 0,以便
FORM
将提供 0 个点Do you have the keyword "
FORM
" in your CPCL label? It's usually before PRINTThis tells the printer to form feed after printing to the top-of-form setting the printer is configured to. To disable it, you can remove the
FORM
keyword from your format if you don't need it, or you can set thetop-of-form
to 0.will show you what your top-of-form is currently set to
will set it to 0, so that the
FORM
will feed 0 dots