That is very strange. I know that the HP LaserJet 6P supports PCL. In fact,
didn't you say that you had printed to this printer previously by sending
the output to a file and then copying the file to the printer? If not, then
you may want to try that just as a sanity check. The only thing that comes
to mind is that something must be altering the contents of the stream before
the printer gets it. I suppose that it is possible that for non-US market
printers (which I assume that this is) that the 6P does not support PCL or
not by default, but this seems a bit unlikely to me. I guess that I would
probably try to track down the owners manual for the actual printer you are
using. I had checked the US HP web site and it indicated that it was PCL
only. Once PCL support is verified, then the next test may be to try
connecting the printer to the LPT port on your printer and printing locally,
to see if maybe something on the network is causing problems. Another easier
thing to test is to verify that you can print to the printer from a normal
windows application (Notepad or something) and check what driver is loaded,
Most HP drivers that I have seen indicate somewhere if they are PCL or
PostScript - not always easy to find, but generally there somewhere.

I hope that this helps... at least it sounds like you are getting closer.
Also, with the recent submission of a PostScript renderer if it turns out
that your printer is PS (I still doubt it) that may be an option...

Art

-----Original Message-----
From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 3:40 AM
To: [EMAIL PROTECTED]
Subject: Re: Help in XML Rendering to PostScript


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]
> >
> > ---------------------------------------------------------------------
> > 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]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to