How can we print a buffered image in java? We can send FileInputStream to Print Service, but i need to send buffered Image to it.
FileInputStream fin = new FileInputStream("YOurImageFileName.PNG");
Doc doc = new SimpleDoc(fin, DocFlavor.INPUT_STREAM.GIF, null);
job.print(doc, pras);
Is it possible?
Check the complete code here.
You can use the iText library.. there is a simple example to print an Image to pdf .
Adding an IText Image to a PDF document