Chris Bowditch wrote:

Neil Guinto wrote:

Ver:  FOP 0.20.5

I need to print a report using a dot matrix printer. The paper size that I'll be using is 8.5in x 14.875in. I initially test it on our laser printer using a letter size paper. The output looks good. On a dot matrix printer (Lexmark 2381+) the font size and line height is totally wrong and its printed sideways.


You don't say which renderer you are using? As a guess I would say you are trying to use Text Renderer, which has a very poor quality of output.

I am using the PrintRenderer. I find TXTRenderer don't preserve the white space on my report which is critical for me for proper positioning and alignment.




This report will be generated by a batch program. In most cases it will be sent to the printer without user intervention. (this part I have a handle by following the servlet example). Other reports will have to use pre-printed forms. I would appreciate it if anybody could respond to this problem and point out some best practice concerning the use of dot matrix printer on FOP.


My old dot matrix used to support PCL. Have you tried generating PCL output and sending that instead of plain Text? It may also be useful if posted a snippet of the code you use to send the generated output to the printer.

<snip/>

protected void render(Source src, Transformer transformer)
throws FOPException, TransformerException, PrinterException, IOException {


       PrinterJob pj = PrinterJob.getPrinterJob();
       pj.setCopies(1);
       pj.setPrintService(getPrintService());
       PrintRenderer renderer = new PrintRenderer(pj);

       //Setup FOP
       Driver driver = new Driver();
       driver.setRenderer(renderer);

       //Setup output
       ByteArrayOutputStream out = new ByteArrayOutputStream();
       driver.setOutputStream(out);

       //Make sure the XSL transformation's result is piped through to FOP
       Result res = new SAXResult(driver.getContentHandler());

       //Start the transformation and rendering process
       transformer.transform(src, res);

       out.close();
   }



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



Reply via email to