On 18.02.2005 11:18:21 Chris Bowditch wrote: > Neil Guinto wrote: > > Jeremias, > > > > Thanks for taking the interest. Ok I'm looking for a quick solution at > > this point without me going into the nitty gritty of implementing a > > method (crunch time :-( ). I've got the actual PDF's rendered somewhere > > on the server side and wanted to route it straight to a network > > printer. Please advise. > > If you havent got time to change FOP's source code as Jeremias suggested then > you are going to need a tool that will print a PDF for you. FOP cant help > except by using the AWTRenderer-which as youve already found out has missing > functionality. > > One tool that can print PDFs is Adobe Server, which is expensive. I seem to > recall you used to be able to make command line calls to the Acrobat Reader > to > print a PDF, but I thought Adobe dropped this feature in later releases.
You can also use GhostScript, for example. Or clicking the following link gives you several pointers to Java packages which support PDF printing: http://www.jguru.com/faq/view.jsp?EID=959950 (Note: I haven't worked with any of them. I'm just giving the links I found googling) > Java 1.5, also has support for printing PDFs. Although other users on this > list have reported problems rendering XSL-FO using FOP on JDK 1.5 > > Others may know of other tools that can be used to print a PDF.... That Java 1.5 has PDF printing support is only a rumour, I'm afraid. I've heard that myself and went looking for it. Found nothing. Some of the packages found following the link above claim to support a JPS (Java Printing System) plug-in that allows to print PDF, however. JPS allows to print arbitrary objects, although each print service only supports a certain subset of "DocFlavors". See the attached jdk15JPSEnum.txt which is a log of the JPSEnum.java I've also attached. It shows what JPS printing services (streaming and non-streaming) are available on my system under JDK 1.5. BTW, JPS is included in JDK 1.4! You can see, for example, that my "GhostScript PDF Writer" printer driver supports several DocFlavors. I'm able print JPEG images coming from an URL or I could simply pipe a PostScript file through to create a PDF (distilling with GhostScript) or I can pass in a Printable object (for example FOP's AWT renderer). If JDK 1.5 supported PDF printing (i.e. not generating PDF through GhostScript like in this example), you'd see a DocFlavor for "application/pdf" similar to the one for "application/postscript". You can also see that my Brother HL-1250 (a PCL laser printer) doesn't support "application/postscript". Just to emphasize that different services have different capabilities. Further down you can see the streaming print services. JDK 1.4 and 1.5 support generation of PostScript files. Sun created a Graphics2D subclass which allows that. Similar to FOP's PSGraphics2D. Speaking of which: Just below that entry you can see two print services that I wrote as a proof of concept which add PDF and PS output support to JPS by delegating to FOP's PSGraphics2D and PDFGraphics2D. This would allow any Java application to generate PDF files via JPS with FOP. Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]