我有以下代码:
FileInputStream fis =
new FileInputStream("C:/test.pdf");
//PrintJob.Builder test = new PrintJob.Builder(fis);
//test.duplex(true);
//test.build();
Map <String,String> newMap = new HashMap<String, String>();
newMap.put("job-attributes", "sides:keyword:two-sided-short-edge#copies:2");
PrintJob pj = new PrintJob.Builder(fis).jobName("testJob").copies(2).attributes(newMap).build();
cp.print(pj);我的问题是,即使我已经将副本设置为(2)它只打印一次...
我做错什么了吗?
发布于 2020-03-04 05:34:10
job-attributes中的copies:2不正确。您需要编写代码:
copies:integer:2不知何故,错误的作业属性条目会导致...
.copies(2)..on要忽略的生成器。
我能够在我的系统上使用较旧的(!)De.spqr-来自2016年的信息cups4j v1.1 (不是当前的v0.7.6 org.cups4j)。
但请注意:如果作业属性值是正确的,则将使用来自Builder的值(即使您没有指定它!在这种情况下,它默认为1)
使用作业属性值的唯一方法是在生成器上显式编码.copies(n) (其中n为<= 0)。
https://stackoverflow.com/questions/21830114
复制相似问题