From 109c667f80e72c278fdaab7c2c090e601fdc2927 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 30 Jun 2005 11:55:46 +0000 Subject: Bugzilla #35561 Print quality improvement especially for printing. The implementations don't create a bitmap image anymore, but draw directly. Submitted by: Richard Wheeldon git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@202539 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/render/print/PrintRenderer.java | 29 +++------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'src/java/org/apache/fop/render/print/PrintRenderer.java') diff --git a/src/java/org/apache/fop/render/print/PrintRenderer.java b/src/java/org/apache/fop/render/print/PrintRenderer.java index bb52ac2ff..e604445ee 100644 --- a/src/java/org/apache/fop/render/print/PrintRenderer.java +++ b/src/java/org/apache/fop/render/print/PrintRenderer.java @@ -18,10 +18,7 @@ package org.apache.fop.render.print; -import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; -import java.awt.image.BufferedImage; import java.awt.print.PageFormat; import java.awt.print.Pageable; import java.awt.print.Paper; @@ -36,8 +33,11 @@ import org.apache.fop.render.java2d.Java2DRenderer; /** * Renderer that prints through java.awt.PrintJob. + * The actual printing is handled by Java2DRenderer + * since both PrintRenderer and AWTRenderer need to + * support printing. */ -public class PrintRenderer extends Java2DRenderer implements Pageable, Printable { +public class PrintRenderer extends Java2DRenderer implements Pageable { private static final int EVEN_AND_ALL = 0; @@ -140,27 +140,6 @@ public class PrintRenderer extends Java2DRenderer implements Pageable, Printable return vec; } - public int print(Graphics g, PageFormat pageFormat, int pageIndex) - throws PrinterException { - if (pageIndex >= getNumberOfPages()) { - return NO_SUCH_PAGE; - } - - Graphics2D g2 = (Graphics2D) g; - - BufferedImage image; - try { - image = getPageImage(pageIndex); - } catch (FOPException e) { - e.printStackTrace(); - return NO_SUCH_PAGE; - } - - g2.drawImage(image, null, 0, 0); - - return PAGE_EXISTS; - } - /** @see java.awt.print.Pageable#getPageFormat(int) */ public PageFormat getPageFormat(int pageIndex) throws IndexOutOfBoundsException { -- cgit v1.2.3