From 9d2aeb2c4bc8b6d375bc59398c72fd658f1800ca Mon Sep 17 00:00:00 2001 From: Adrian Cumiskey Date: Thu, 16 Oct 2008 13:06:58 +0000 Subject: Added GOCA mime. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@705234 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java | 7 +++++++ src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java | 1 + 2 files changed, 8 insertions(+) (limited to 'src/java/org/apache') diff --git a/src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java b/src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java index 5128b96cf..dc86b8c38 100644 --- a/src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java +++ b/src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java @@ -24,6 +24,7 @@ import java.io.IOException; import org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D; import org.apache.xmlgraphics.java2d.Graphics2DImagePainter; +import org.apache.xmlgraphics.util.MimeConstants; /** @@ -50,6 +51,10 @@ public class AFPImageGraphics2DFactory extends AFPDataObjectInfoFactory { AFPGraphicsObjectInfo graphicsObjectInfo = (AFPGraphicsObjectInfo)super.create(afpImageInfo); + // set mime type (unsupported by MOD:CA registry) + graphicsObjectInfo.setMimeType(MimeConstants.MIME_AFP_GOCA); + + // set graphics 2d AFPGraphics2DAdapter g2dAdapter = afpImageInfo.g2dAdapter; AFPGraphics2D g2d = g2dAdapter.getGraphics2D(); AFPInfo afpInfo = AFPSVGHandler.getAFPInfo(afpImageInfo.rendererContext); @@ -58,10 +63,12 @@ public class AFPImageGraphics2DFactory extends AFPDataObjectInfoFactory { g2d.setState(state); graphicsObjectInfo.setGraphics2D(g2d); + // set painter ImageGraphics2D imageG2D = (ImageGraphics2D)afpImageInfo.img; Graphics2DImagePainter painter = imageG2D.getGraphics2DImagePainter(); graphicsObjectInfo.setPainter(painter); + // set object area AFPObjectAreaInfo objectAreaInfo = graphicsObjectInfo.getObjectAreaInfo(); Rectangle area = new Rectangle(objectAreaInfo.getWidth(), objectAreaInfo.getHeight()); graphicsObjectInfo.setArea(area); diff --git a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java index 85784af55..aba38af2f 100644 --- a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java +++ b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java @@ -240,6 +240,7 @@ public class AFPRendererConfigurator extends PrintRendererConfigurator { } else { afpRenderer.setColorImages(true); } + // images are embedded directly without conversion to bitmapped IOCA afpRenderer.setNativeImages(imagesCfg.getAttributeAsBoolean("native", false)); -- cgit v1.2.3