RE: Help in XML Rendering to PostScript
The code looks correct to me. I am just about out of ideas on this. If other applications are able to print to this printer successfully, then this should work. Have you tried the PS renderer yet? The JDK printing API should not come in to play on this. We are sending the print data directly to the printer. I am still a little suspicious that something between FOP and the printer is filtering the stream. As a sanity check I would try connecting the printer locally to see if it works any better. Sorry I could not be more helpful, Art -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 26, 2001 3:58 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript I tried setting the PJL ENTER LANGUAGE = PCL and then sending the output to the printer but the printer printed the same old junk characters it was doing earlier Here is my piece of code: -- -- FileOutputStream fos = new FileOutputStream(Melstar\\Melprn); fos.write(\033%-12345X@PJL ENTER LANGUAGE = PCL\r\n.getBytes()); Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PCL); driver.addElementMapping(org.apache.fop.fo.StandardElementMapping); driver.addElementMapping(org.apache.fop.svg.SVGElementMapping); driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping); driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping); driver.setOutputStream(fos); driver.buildFOTree(parser, new InputSource(args[0])); driver.format(); driver.render(); fos.write(\033%-12345X@PJL ENTER LANGUAGE = POSTSCRIPT\r\n.getBytes()); fos.close(); I used the jdk 1.4 beta which has much better printing support than it's predecessors and used it's new java printing service API to query my printer. Whichever way I query my printer it always tells me that the supported file format to print is gif, jpeg and png. If I try to set the DocFlavor as POSTSCRIPT or PDF it throws me an exception. I hitting a dead end it seems. Thanks, Hitesh Art Welch wrote: I think that it is probably most likely that something is altering the escape characters in the print stream before the printer gets it. The text renderer of course has no escape characters in it's output. If your printer was PS only then the plain text output would not have printed correctly either (unless something interpreted it for the printer). PCL however will print plain text properly (depending on line feeds and form feeds being appropriate). OK! I just did some more looking on the HP site and it looks like the 6MP should support both PCL and PostScript. If the default is PS and you want to leave the printer that way then you may need to use the PJL commands to switch the language in software (see http://www.hp.com/cposupport/printers/support_doc/bpl01378.html). If you want to try this, after you open the file output stream you would write the enter language PCL command \033%-12345X@PJL ENTER LANGUAGE = PCL\r\n to the output stream before giving the stream to Driver. After Driver has rendered the PCL you could reset the language to PS before closing the stream with \033%-12345X@PJL ENTER LANGUAGE = POSTSCRIPT\r\n. I hope that this solves the problem for you, Art -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 3:56 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript also if I use driver.setRenderer(Driver.RENDER_TXT); and send the output to the printer straight away the printer is able to understand the output and is able to print the text output. But the quality of the output falls far short of what a pdf output can provide. Thanks, Hitesh Hitesh Bagchi wrote: I used the following piece of code to send the pcl output to the printer(HP Laser Jet 6P/6MP network printer): FileOutputStream fos = new FileOutputStream(Melstar\\Melprn); Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PCL); driver.addElementMapping(org.apache.fop.fo.StandardElementMapping); driver.addElementMapping(org.apache.fop.svg.SVGElementMapping); driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping); driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping); driver.setOutputStream(fos); driver.buildFOTree(parser, new InputSource(args[0])); driver.format(); driver.render(); And everything went smoothly. Only the printer printed a lot of junk characters like you would get if you write the pcl output to a file and send the file to a printer as a text file. Does it mean my printer do not understand pcl output. Thanks, Hitesh Art Welch wrote: I am not sure if I have the syntax exactly correct (and I do not have FOP installed on my
Re: Help in XML Rendering to PostScript
also if I use driver.setRenderer(Driver.RENDER_TXT); and send the output to the printer straight away the printer is able to understand the output and is able to print the text output. But the quality of the output falls far short of what a pdf output can provide. Thanks, Hitesh Hitesh Bagchi wrote: I used the following piece of code to send the pcl output to the printer(HP Laser Jet 6P/6MP network printer): FileOutputStream fos = new FileOutputStream(Melstar\\Melprn); Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PCL); driver.addElementMapping(org.apache.fop.fo.StandardElementMapping); driver.addElementMapping(org.apache.fop.svg.SVGElementMapping); driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping); driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping); driver.setOutputStream(fos); driver.buildFOTree(parser, new InputSource(args[0])); driver.format(); driver.render(); And everything went smoothly. Only the printer printed a lot of junk characters like you would get if you write the pcl output to a file and send the file to a printer as a text file. Does it mean my printer do not understand pcl output. Thanks, Hitesh Art Welch wrote: I am not sure if I have the syntax exactly correct (and I do not have FOP installed on my Windows 2000 or NT workstations at the moment), but in the past I have successfully printed directly to a network printer, just by opening a file stream to it. For example in your example only the first line would need to change something like: FileOutputStream fos = new FileOutputStream(hostname\\printername); For a local printer you should be able to do something like: FileOutputStream fos = new FileOutputStream(lpt1); HTH, Art -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 21, 2001 12:35 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript I am using windows NT and I am trying to print the PCL output directly to the printer which is a HP Laser Jet 6P/6MP network printer from my application. Here is my piece of code : -- --- FileOutputStream fos = new FileOutputStream(../temp/tTest.pcl); Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PCL); driver.addElementMapping(org.apache.fop.fo.StandardElementMapping); driver.addElementMapping(org.apache.fop.svg.SVGElementMapping); driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping); driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping); driver.setOutputStream(fos); driver.buildFOTree(parser, new InputSource(args[0])); driver.format(); driver.render(); --- Now instead of printing to the Test.pcl file I want to send the output directly to the HP Laser Jet 6P/6MP printer on the network. Thanks, Hitesh Art Welch wrote: I thought that I had answered a question about direct printing PCL recently. If you will tell me what platform you are using (Windows/Unix) and how you are invoking FOP (application or command line). I will try to answer this. Art -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 16, 2001 1:50 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript Hello, Can somebody tell me how to stream PCL output to a network printer without writing to a file. Thanks, Hitesh [EMAIL PROTECTED] wrote: Hello, I am fairly new to FOP and to Java as well. I am wondering if anyone has written a rendering to convert an XML stream to Postscript with FOP (similar to the PCL or PDF renderer) - I am in desperate need of a mechanism to do this. We have a current Java app that converts an XML stream into PDF, but printing through Adobe Acrobat is too resource intensive on the lower end machines. I have tried converting to PCL and then streaming to a port, which works pretty well, but is not a 100% compatibile (PCL beng only HP) If anyone knows of a way to convert an XML to PS format using a custom FOP piece they've written, or knows of a better mechanism, I'd be forever grateful! Thanks very much, Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED
RE: Help in XML Rendering to PostScript
In terms of the solution for streaming to an LPT port or network printer, is there a way to catch an error if this fails? Lets say I have a network printer and it is offline, how can I know if it worked or not? It's a blind process. Thanks! -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 3:56 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript also if I use driver.setRenderer(Driver.RENDER_TXT); and send the output to the printer straight away the printer is able to understand the output and is able to print the text output. But the quality of the output falls far short of what a pdf output can provide. Thanks, Hitesh Hitesh Bagchi wrote: I used the following piece of code to send the pcl output to the printer(HP Laser Jet 6P/6MP network printer): FileOutputStream fos = new FileOutputStream(Melstar\\Melprn); Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PCL); driver.addElementMapping(org.apache.fop.fo.StandardElementMapping); driver.addElementMapping(org.apache.fop.svg.SVGElementMapping); driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping); driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping); driver.setOutputStream(fos); driver.buildFOTree(parser, new InputSource(args[0])); driver.format(); driver.render(); And everything went smoothly. Only the printer printed a lot of junk characters like you would get if you write the pcl output to a file and send the file to a printer as a text file. Does it mean my printer do not understand pcl output. Thanks, Hitesh Art Welch wrote: I am not sure if I have the syntax exactly correct (and I do not have FOP installed on my Windows 2000 or NT workstations at the moment), but in the past I have successfully printed directly to a network printer, just by opening a file stream to it. For example in your example only the first line would need to change something like: FileOutputStream fos = new FileOutputStream(hostname\\printername); For a local printer you should be able to do something like: FileOutputStream fos = new FileOutputStream(lpt1); HTH, Art -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 21, 2001 12:35 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript I am using windows NT and I am trying to print the PCL output directly to the printer which is a HP Laser Jet 6P/6MP network printer from my application. Here is my piece of code : -- --- FileOutputStream fos = new FileOutputStream(../temp/tTest.pcl); Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PCL); driver.addElementMapping(org.apache.fop.fo.StandardElementMapping); driver.addElementMapping(org.apache.fop.svg.SVGElementMapping); driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping); driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping); driver.setOutputStream(fos); driver.buildFOTree(parser, new InputSource(args[0])); driver.format(); driver.render(); --- Now instead of printing to the Test.pcl file I want to send the output directly to the HP Laser Jet 6P/6MP printer on the network. Thanks, Hitesh Art Welch wrote: I thought that I had answered a question about direct printing PCL recently. If you will tell me what platform you are using (Windows/Unix) and how you are invoking FOP (application or command line). I will try to answer this. Art -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 16, 2001 1:50 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript Hello, Can somebody tell me how to stream PCL output to a network printer without writing to a file. Thanks, Hitesh [EMAIL PROTECTED] wrote: Hello, I am fairly new to FOP and to Java as well. I am wondering if anyone has written a rendering to convert an XML stream to Postscript with FOP (similar to the PCL or PDF renderer) - I am in desperate need of a mechanism to do this. We have a current Java app that converts an XML stream into PDF, but printing through Adobe Acrobat is too resource intensive on the lower end machines. I have tried converting to PCL and then streaming to a port, which works pretty well, but is not a 100% compatibile (PCL beng only HP) If anyone knows of a way to convert an XML to PS format using a custom FOP piece they've written, or knows of a better mechanism, I'd be forever grateful
RE: Help in XML Rendering to PostScript
I thought that I had answered a question about direct printing PCL recently. If you will tell me what platform you are using (Windows/Unix) and how you are invoking FOP (application or command line). I will try to answer this. Art -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 16, 2001 1:50 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript Hello, Can somebody tell me how to stream PCL output to a network printer without writing to a file. Thanks, Hitesh [EMAIL PROTECTED] wrote: Hello, I am fairly new to FOP and to Java as well. I am wondering if anyone has written a rendering to convert an XML stream to Postscript with FOP (similar to the PCL or PDF renderer) - I am in desperate need of a mechanism to do this. We have a current Java app that converts an XML stream into PDF, but printing through Adobe Acrobat is too resource intensive on the lower end machines. I have tried converting to PCL and then streaming to a port, which works pretty well, but is not a 100% compatibile (PCL beng only HP) If anyone knows of a way to convert an XML to PS format using a custom FOP piece they've written, or knows of a better mechanism, I'd be forever grateful! Thanks very much, Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Help in XML Rendering to PostScript
Hello, I am using FOP from within a java application and writing a PCL file. I then pass that PCL file to the LPT port for printing. I want to be able to render it as Postscript, not PCL. Any advice or insight you have into post script or direct printing would be gratefully appreciated! Tony -Original Message- From: Art Welch [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 20, 2001 2:01 PM To: '[EMAIL PROTECTED]' Subject: RE: Help in XML Rendering to PostScript I thought that I had answered a question about direct printing PCL recently. If you will tell me what platform you are using (Windows/Unix) and how you are invoking FOP (application or command line). I will try to answer this. Art -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 16, 2001 1:50 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript Hello, Can somebody tell me how to stream PCL output to a network printer without writing to a file. Thanks, Hitesh [EMAIL PROTECTED] wrote: Hello, I am fairly new to FOP and to Java as well. I am wondering if anyone has written a rendering to convert an XML stream to Postscript with FOP (similar to the PCL or PDF renderer) - I am in desperate need of a mechanism to do this. We have a current Java app that converts an XML stream into PDF, but printing through Adobe Acrobat is too resource intensive on the lower end machines. I have tried converting to PCL and then streaming to a port, which works pretty well, but is not a 100% compatibile (PCL beng only HP) If anyone knows of a way to convert an XML to PS format using a custom FOP piece they've written, or knows of a better mechanism, I'd be forever grateful! Thanks very much, Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Help in XML Rendering to PostScript
I am using windows NT and I am trying to print the PCL output directly to the printer which is a HP Laser Jet 6P/6MP network printer from my application. Here is my piece of code : - FileOutputStream fos = new FileOutputStream(../temp/tTest.pcl); Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PCL); driver.addElementMapping(org.apache.fop.fo.StandardElementMapping); driver.addElementMapping(org.apache.fop.svg.SVGElementMapping); driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping); driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping); driver.setOutputStream(fos); driver.buildFOTree(parser, new InputSource(args[0])); driver.format(); driver.render(); --- Now instead of printing to the Test.pcl file I want to send the output directly to the HP Laser Jet 6P/6MP printer on the network. Thanks, Hitesh Art Welch wrote: I thought that I had answered a question about direct printing PCL recently. If you will tell me what platform you are using (Windows/Unix) and how you are invoking FOP (application or command line). I will try to answer this. Art -Original Message- From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 16, 2001 1:50 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript Hello, Can somebody tell me how to stream PCL output to a network printer without writing to a file. Thanks, Hitesh [EMAIL PROTECTED] wrote: Hello, I am fairly new to FOP and to Java as well. I am wondering if anyone has written a rendering to convert an XML stream to Postscript with FOP (similar to the PCL or PDF renderer) - I am in desperate need of a mechanism to do this. We have a current Java app that converts an XML stream into PDF, but printing through Adobe Acrobat is too resource intensive on the lower end machines. I have tried converting to PCL and then streaming to a port, which works pretty well, but is not a 100% compatibile (PCL beng only HP) If anyone knows of a way to convert an XML to PS format using a custom FOP piece they've written, or knows of a better mechanism, I'd be forever grateful! Thanks very much, Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Help in XML Rendering to PostScript
Quoting Jeremias Maerki [EMAIL PROTECTED]: I've started a Postscript renderer some time ago. It produces Level 2 Postscript and DSC comments. It's certainly not production ready, though. The whole SVG stuff is missing and it would have to be updated for the current CVS version. If it helped you I could update the code to fit with the current CVS version and post it to be integrated with FOP. You would have to give me a week or so to do that. Just tell me. Also depends on the comitters if they want the code in the current status... Whatever status the code is in, if you are reasonably happy with the design behind it, please feel free to submit it. The last thing we try (or want) to do is to foster an impression that people have to provide code-complete modules; as long as it compiles and doesn't break other code, we are happy to have it. The whole point of open-source is that we try to get code in early and often. That way other people can look at it, and take it into account, and maybe work with it, too. It also insures against the possibility that you, or anyone, just never has the time to really finish the job, and every time you look at what you have you want to improve it, and it never actually sees the light of day. I am as guilty as anyone, of holding off on submitting things into CVS until I have finished works of art. And I really get bit with the improvement bug I described above. :-) But this is just not the way to do things in open-source, as a rule. So, in summary, please feel free to submit what you have. What you can do in any case is make it clear that you wish to remain the prime on that piece of code, and that if anyone else wishes to work on it they should coordinate with you. But since you're new to Java I doubt that it will help you much because you would have to improve the code yourself (or find someone to do it for you). Regards, Arved Sandstrom --- This mail was sent through the Nova Scotia Provincial Server, with technical resources provided by Chebucto Community Net. http://nsaccess.ns.ca/mail/ http://www.chebucto.ns.ca/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Help in XML Rendering to PostScript
Hello, Can somebody tell me how to stream PCL output to a network printer without writing to a file. Thanks, Hitesh [EMAIL PROTECTED] wrote: Hello, I am fairly new to FOP and to Java as well. I am wondering if anyone has written a rendering to convert an XML stream to Postscript with FOP (similar to the PCL or PDF renderer) - I am in desperate need of a mechanism to do this. We have a current Java app that converts an XML stream into PDF, but printing through Adobe Acrobat is too resource intensive on the lower end machines. I have tried converting to PCL and then streaming to a port, which works pretty well, but is not a 100% compatibile (PCL beng only HP) If anyone knows of a way to convert an XML to PS format using a custom FOP piece they've written, or knows of a better mechanism, I'd be forever grateful! Thanks very much, Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Help in XML Rendering to PostScript
I am fairly new to FOP and to Java as well. I am wondering if anyone has written a rendering to convert an XML stream to Postscript with FOP (similar to the PCL or PDF renderer) - I am in desperate need of a mechanism to do this. We have a current Java app that converts an XML stream into PDF, but printing through Adobe Acrobat is too resource intensive on the lower end machines. I have tried converting to PCL and then streaming to a port, which works pretty well, but is not a 100% compatibile (PCL beng only HP) If anyone knows of a way to convert an XML to PS format using a custom FOP piece they've written, or knows of a better mechanism, I'd be forever grateful! I've started a Postscript renderer some time ago. It produces Level 2 Postscript and DSC comments. It's certainly not production ready, though. The whole SVG stuff is missing and it would have to be updated for the current CVS version. If it helped you I could update the code to fit with the current CVS version and post it to be integrated with FOP. You would have to give me a week or so to do that. Just tell me. Also depends on the comitters if they want the code in the current status... But since you're new to Java I doubt that it will help you much because you would have to improve the code yourself (or find someone to do it for you). Have you tried Ghostscript for the conversion? I don't know, but it might be worth a try. Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029 Internet http://www.outline.ch - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Help in XML Rendering to PostScript
Hello, It is for a company in South American, and the low end platforms are either P133/32 or P200/64 - launching it in Adobe Acrobat to print takes a long time/ -Original Message- From: Alex McLintock [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 11:36 AM To: [EMAIL PROTECTED] Subject: Re: Help in XML Rendering to PostScript --- [EMAIL PROTECTED] wrote: Hello, I have tried converting to PCL and then streaming to a port, which works pretty well, but is not a 100% compatibile (PCL beng only HP) IMHO a large number of printers are PCL compatible nowadays - even those not made by HP. I'd say they were more common than postscript - Why are you doing this on low spec machines? Alex = Alex McLintock[EMAIL PROTECTED]Open Source Consultancy in London OpenWeb Analysts Ltd, http://www.OWAL.co.uk/ DR WHO COMPETITION: http://www.diversebooks.com/cgi-bin/caption/captions.cgi?date=200104 Get Your XML T-Shirt t-shirt/ at http://www.inversity.co.uk/ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]