I have an issue when trying to print a PDF file using Java. Here is my code:
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()
I use document.silentPrint(job);
and job.print(printRequestAttributeSet);
- it works fine. If I use document.silentPrint(job);
- I can't set the PrintRequestAttributeSet
.
Can anyone tell me how to set the PrintRequestAttributeSet?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…