diff options
Diffstat (limited to 'src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java')
-rw-r--r-- | src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java index 0c6ebde56..262caa53b 100644 --- a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java @@ -36,7 +36,7 @@ import org.apache.xmlgraphics.image.writer.ImageWriter; import org.apache.xmlgraphics.image.writer.ImageWriterRegistry; import org.apache.xmlgraphics.image.writer.MultiImageWriter; -import org.apache.fop.apps.FopFactoryConfigurator; +import org.apache.fop.apps.FopFactoryConfig; import org.apache.fop.fonts.FontInfo; import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler; import org.apache.fop.render.intermediate.IFContext; @@ -80,7 +80,14 @@ public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritin /** * Default constructor. */ - public AbstractBitmapDocumentHandler() { + public AbstractBitmapDocumentHandler(IFContext context) { + super(context); + //Set target resolution + int dpi = Math.round(context.getUserAgent().getTargetResolution()); + getSettings().getWriterParams().setResolution(dpi); + + Map renderingOptions = getUserAgent().getRendererOptions(); + setTargetBitmapSize((Dimension)renderingOptions.get(TARGET_BITMAP_SIZE)); } /** {@inheritDoc} */ @@ -98,18 +105,6 @@ public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritin public abstract String getDefaultExtension(); /** {@inheritDoc} */ - public void setContext(IFContext context) { - super.setContext(context); - - //Set target resolution - int dpi = Math.round(context.getUserAgent().getTargetResolution()); - getSettings().getWriterParams().setResolution(dpi); - - Map renderingOptions = getUserAgent().getRendererOptions(); - setTargetBitmapSize((Dimension)renderingOptions.get(TARGET_BITMAP_SIZE)); - } - - /** {@inheritDoc} */ public abstract IFDocumentHandlerConfigurator getConfigurator(); /** @@ -228,7 +223,7 @@ public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritin //Normal case: just scale according to the target resolution scale = scaleFactor * getUserAgent().getTargetResolution() - / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION; + / FopFactoryConfig.DEFAULT_TARGET_RESOLUTION; bitmapWidth = (int) ((this.currentPageDimensions.width * scale / 1000f) + 0.5f); bitmapHeight = (int) ((this.currentPageDimensions.height * scale / 1000f) + 0.5f); } |