Problems with DocFlavor.INPUT_STREAM.PDF (printing PDFs)
807580Jun 18 2007 — edited Mar 17 2010I've looked all around these forums, and all around the rest of the web, and from I can tell the best way to print a PDF document to a printer in Java is to use the javax.print.* (Java Print Service API stiff).
I have managed to write (well, piece together) code that allows me to print images with the DocFlavor.INPUT_STREAM.JPEG/GIF, however when I try to print anything else (PDF, PS, TEXT, etc) the PrintServiceLookup returns a big fat ZERO for the number of printers that can handle these formats. I don't understand why JPEG and GIF would work, but not plain TEXT_PLAIN_US_ASCII which I'd assume is almost as basic as you can get...
I am hoping for some insite, or some possible things to try. I am new to Java programming but as far as I can tell, the printer itself is being basically asked, "hey, can you print a document with this type and these settings (PrintRequestAttributeSet)?" My "printer" is a networked giant corperate laser printer and should be able to handle basically anything, I'd think...
I've also tried a newer printer and get the same results - JPEG and GIF work perfectly, but nothing else does!