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
Try this code:
FileInputStream fis = new FileInputStream(“C:/mypdf.pdf”); Doc pdfDoc = new SimpleDoc(fis, null, null); DocPrintJob printJob = printService.createPrintJob(); printJob.print(pdfDoc, new HashPrintRequestAttributeSet()); fis.close();
You can also follow these steps