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?