我们最近购买了brother QL-700打印机,我们正在通过本机进行一些不干胶打印。无法指定正确的打印尺寸
我们一直在喂养的纸是没有“长度”限制的62mm-wide sticker roll。
问题是,不管我怎么做(我试过Book
,PrintRequestAttributeSet
),我都无法使用Java来告诉打印机对话框窗口使用正确的打印机纸张尺寸。我无法做到,例如,准确的62mm × 40毫米,因为我们需要。它总是“捕捉”到最近的文件,因为它想:
这里是有问题的代码:
PrinterJob job = PrinterJob.getPrinterJob();
PageFormat pf = job.defaultPage();
Paper p = pf.getPaper();
p.setSize(UnitConv.mm2pt(62), UnitConv.mm2pt(40));
p.setImageableArea(0, 0, UnitConv.mm2pt(62), UnitConv.mm2pt(40));
pf.setPaper(p);
pf.setOrientation(PageFormat.LANDSCAPE);
job.setPrintable(this, pf);
if (job.printDialog()) {
try {
job.print();
} catch (Exception PrintException) {
PrintException.printStackTrace();
}
}
我可以证实,打印机可以在任意长度打印如下图所示(使用Brother的P-touch编辑器)。公告虽然它的调整,但36mm
由软件本身预设:
于是问:
如何强制纸张“length
”确切40毫米?
相关: custom paper size for labelprinter (Brother QL 570)
编辑
我做了一个媒体尺寸查询(code),这里是媒体的名单,它可以支持:
17 mm x 54 mm: width = 0.67; height = 2.12
17 mm x 87 mm: width = 0.67; height = 3.42
23 mm x 23 mm: width = 0.9066535; height = 0.9066535
iso-b10: width = 1.2204725; height = 1.7322835
29 mm x 90 mm: width = 1.14; height = 3.5366535
38 mm x 90 mm: width = 1.4966536; height = 3.5366535
39 mm x 48 mm: width = 1.5366535; height = 1.8833464
52 mm x 29 mm: width = 1.1366535; height = 2.0466535
iso-b8: width = 2.440945; height = 3.464567
62 mm x 29 mm: width = 1.1366535; height = 2.44
62 mm x 100 mm: width = 2.44; height = 3.93
12 mm Dia: width = 0.47334644; height = 0.47334644
23 mm x 23 mm: width = 0.9066535; height = 0.9066535
58 mm Dia: width = 2.2933464; height = 2.2933464
12 mm: width = 0.47334644; height = 3.9366536
29 mm: width = 1.14; height = 3.9366536
38 mm: width = 1.4966536; height = 3.9366536
50 mm: width = 1.9666536; height = 3.9366536
54 mm: width = 2.1266534; height = 3.9366536
62 mm x 100 mm: width = 2.44; height = 3.93
12 mm x2: width = 0.82665354; height = 3.9366536
54 mm: width = 2.1266534; height = 3.9366536
38 mm x2: width = 2.8733466; height = 3.9366536
50 mm x2: width = 3.8133464; height = 3.9366536
54 mm x2: width = 3.9366536; height = 4.0933466
62 mm x2: width = 3.9366536; height = 4.76
29 mm: width = 1.14; height = 3.9366536
29 mm x3: width = 3.18; height = 3.9366536
38 mm x3: width = 3.9366536; height = 4.25
50 mm x3: width = 3.9366536; height = 5.66
54 mm x3: width = 3.9366536; height = 6.06
62 mm x3: width = 3.9366536; height = 7.08
38 mm: width = 1.4966536; height = 3.9366536
29 mm x4: width = 3.9366536; height = 4.2
38 mm x4: width = 3.9366536; height = 5.6266537
50 mm x4: width = 3.9366536; height = 7.5066533
54 mm x4: width = 3.9366536; height = 8.026653
62 mm x4: width = 3.9366536; height = 9.4
29 mm x 90 mm: width = 1.14; height = 3.5366535
38 mm x 90 mm: width = 1.4966536; height = 3.5366535
Small Address Label: width = 1.1366535; height = 2.44
17 mm x 54 mm: width = 0.67; height = 2.12
62 mm x 100 mm: width = 2.44; height = 3.93
62 mm x 100 mm: width = 2.44; height = 3.93
17 mm x 87 mm: width = 0.67; height = 3.42
17 mm x 54 mm: width = 0.67; height = 2.12
Binder 3 cm - Spine: width = 1.14; height = 8.226653
Binder 5 cm - Spine: width = 2.44; height = 8.226653
58 mm Dia: width = 2.2933464; height = 2.2933464
12 mm Dia: width = 0.47334644; height = 0.47334644
23 mm x 23 mm: width = 0.9066535; height = 0.9066535
23 mm x 23 mm: width = 0.9066535; height = 0.9066535
62 mm x 184 mm Postage Label: width = 2.44; height = 7.24
Binder 5 cm - Spine: width = 2.44; height = 8.226653
编辑( 2017年4月)
只是为了更新此问题的状态。最后,我通过使用python和开源工具brother_ql解决了这个问题,它直接将作业发送到USB端口,而无需使用兄弟提供的固件。它工作得很好,解决了我的问题。
谢谢。打印机的问题在于,无论您设置什么尺寸,打印机服务似乎都会“贴”到他们喜欢的最接近的尺寸,这与打印机不兼容,因为打印机可以打印62毫米x *毫米的纸张尺寸。他们提供的软件证明它可以完成,但不能用于Java。不知何故,我没有得到正确的组合,或者Java服务不支持它。 –