From 593cb69d65d69473cf985ce627095387fa1450ec Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 2 Mar 2009 09:19:48 +0000 Subject: [PATCH] AFP: Backported IMM (Invoke Medium Map) to AFPRenderer. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@749251 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/render/afp/AFPRenderer.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/fop/render/afp/AFPRenderer.java b/src/java/org/apache/fop/render/afp/AFPRenderer.java index d1d2bec3b..03e7a9977 100644 --- a/src/java/org/apache/fop/render/afp/AFPRenderer.java +++ b/src/java/org/apache/fop/render/afp/AFPRenderer.java @@ -63,8 +63,8 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.MimeConstants; import org.apache.fop.area.CTM; -import org.apache.fop.area.LineArea; import org.apache.fop.area.OffDocumentItem; +import org.apache.fop.area.PageSequence; import org.apache.fop.area.PageViewport; import org.apache.fop.area.Trait; import org.apache.fop.area.inline.Image; @@ -80,6 +80,7 @@ import org.apache.fop.render.AbstractPathOrientedRenderer; import org.apache.fop.render.Graphics2DAdapter; import org.apache.fop.render.RendererContext; import org.apache.fop.render.afp.extensions.AFPElementMapping; +import org.apache.fop.render.afp.extensions.AFPInvokeMediumMap; import org.apache.fop.render.afp.extensions.AFPPageSetup; /** @@ -213,12 +214,26 @@ public class AFPRenderer extends AbstractPathOrientedRenderer implements AFPCust } /** {@inheritDoc} */ - public void startPageSequence(LineArea seqTitle) { + public void startPageSequence(PageSequence pageSequence) { + super.startPageSequence(pageSequence); try { dataStream.startPageGroup(); } catch (IOException e) { log.error(e.getMessage()); } + if (pageSequence.hasExtensionAttachments()) { + for (Iterator iter = pageSequence.getExtensionAttachments().iterator(); + iter.hasNext();) { + ExtensionAttachment attachment = (ExtensionAttachment)iter.next(); + if (attachment instanceof AFPInvokeMediumMap) { + AFPInvokeMediumMap imm = (AFPInvokeMediumMap)attachment; + String mediumMap = imm.getName(); + if (mediumMap != null) { + dataStream.createInvokeMediumMap(mediumMap); + } + } + } + } } /** {@inheritDoc} */ -- 2.39.5