I am using jwt awt to print pdf file in java. But the print keeps printing in unknown format and forever. Please find the below image,
I have used java code,
PrintService service = PrintUtility.findPrintService("Champ RP Series");
FileInputStream inputStream = new FileInputStream("D:/Rose/Work/17.pdf");
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
pras.add(new Copies(1));
DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
Doc doc = new SimpleDoc(inputStream, flavor, null);
DocPrintJob job = service.createPrintJob();
job.print(doc, pras);
inputStream.close();
Is there any way to preview this before printing? How can I solve this issue? Thank you