我在使用Java打印PDF文件时遇到了问题。这是我的代码:
PdfReader readFtp = new PdfReader(); // This class is used for reading a PDF file
PDDocument document = readFtp.readFTPFile(documentID);
printRequestAttributeSet.add(new PageRanges(1, 10));
job.setPageable(document);
job.print(printRequestAttributeSet); // calling for print
document.close()
我使用 document.silentPrint(job);
和 job.print(printRequestAttributeSet);
- 它正常工作。如果我使用 document.silentPrint(job);
- 我无法设置PrintRequestAttributeSet
。
请问有人可以告诉我如何设置PrintRequestAttributeSet吗?