From a56f97607b7260a1ebfde968d53d35a5b333d6df Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Tue, 10 Feb 2015 13:21:17 +0000 Subject: [PATCH] FOP-2448: PDF to PS deduplication of images git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1658710 13f79535-47bb-0310-9956-ffa450edef68 --- lib/xmlgraphics-commons-svn-trunk.jar | Bin 632559 -> 632951 bytes .../fop/render/ps/PSDocumentHandler.java | 43 ++++++++++++++---- .../fop/render/ps/PSGraphics2DAdapter.java | 5 +- .../render/ps/PSImageHandlerGraphics2D.java | 5 +- .../apache/fop/render/ps/PSImageUtils.java | 3 ++ 5 files changed, 46 insertions(+), 10 deletions(-) diff --git a/lib/xmlgraphics-commons-svn-trunk.jar b/lib/xmlgraphics-commons-svn-trunk.jar index 7335647260ad3336f71ad03fa30c589175539c47..262c55b31ee1df9115e8f9cca5acd6600c866886 100644 GIT binary patch delta 20926 zcmb7s2UHYS`}gk7&dv-S1f*B#-HwQW1q({Cqd>skv3CR%yCS%Tt0IC?gI&<*s?lIK zmLL#~U9rSO6v4duT7vpL_ugUI!T0>n`8>z7W%w8BwH_D zao&C6l79Wy&n!<*9hTzxY5wbv<-zw?jh|;;zI{nav`wPoLaXe-pOzo88Tz}x59|2w zN$2eLg98IP4oi>z;^uzvs==vB#d_}Q=A_dXZ=V_ZoJqIn8Pe`;SD|*S{AShrCuaW+ ztW8guc&Fm>MK;=N`vb>khb|Pf{b%-#y01gqb~u_ffAc5%&*QScEQy!T8FORd(TJ*f zVH?KJADk9)t< zr`FT^&gdH(S2TEB%4nwVoBSs>ue-GkDgDlPzVLY3TQ=4}H#_PHaz6&rquwlcB)=!+ z?hIs2{inP&`L$7WBy<~vCvy6#P)U=k&QWwBaHXOv`88zyQT;%LzB-1{(-KNHEA(~b zu(^k`N#%*EtyLDyB1_bRM5VDDGU=pJHu;5fdPL=!w@sx~JMjWBU90j` z=kT0*IIlI%n6HPrGQL{2dBfn!mTGcTwU1u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Ymj3j`an`BQEQ3M?Dl@3Q$Ou4uWt0 zO2r+-F$}$_#*hz+yTUgk$NOX)t@f}D&V^VX`l6mZxS^wmOIusT(}+b|LDca-D0Fda z(~%Qy9d?hl9=gxlpjlhRnQYMX@U06$K`vy2^g7>;hnSw0hO!?)z|zOKArz_MyFX&w zkimcZ#qwf# getImages(); + } + + public class FOPPSGeneratorImpl extends PSGenerator implements FOPPSGenerator { + private Map images = new HashMap(); + public FOPPSGeneratorImpl(OutputStream out) { + super(out); + } + + /** Need to subclass PSGenerator to have better URI resolution */ + @Override + public Source resolveURI(String uri) { + return getUserAgent().resolveURI(uri); + } + + public PSDocumentHandler getHandler() { + return PSDocumentHandler.this; + } + + public BufferedOutputStream getTempStream(URI uri) throws IOException { + return new BufferedOutputStream(getUserAgent().getResourceResolver().getOutputStream(uri)); + } + + public Map getImages() { + return images; + } + } + private void writeHeader() throws IOException { //PostScript Header gen.writeln(DSCConstants.PS_ADOBE_30); @@ -558,7 +585,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { * @param uri the image URI * @return a PSResource instance */ - protected PSResource getFormForImage(String uri) { + public PSResource getFormForImage(String uri) { if (uri == null || "".equals(uri)) { throw new IllegalArgumentException("uri must not be empty or null"); } diff --git a/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java b/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java index 7bbe9bd8b..2ed64e770 100644 --- a/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java +++ b/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java @@ -26,6 +26,7 @@ import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Map; +import org.apache.xmlgraphics.java2d.GeneralGraphics2DImagePainter; import org.apache.xmlgraphics.java2d.Graphics2DImagePainter; import org.apache.xmlgraphics.java2d.ps.PSGraphics2D; import org.apache.xmlgraphics.ps.PSGenerator; @@ -94,7 +95,9 @@ public class PSGraphics2DAdapter extends AbstractGraphics2DAdapter { gen.concatMatrix(sx, 0, 0, sy, fx, fy); final boolean textAsShapes = false; - PSGraphics2D graphics = new PSGraphics2D(textAsShapes, gen); + PSGraphics2D graphics = (painter instanceof GeneralGraphics2DImagePainter) + ? (PSGraphics2D) ((GeneralGraphics2DImagePainter) painter).getGraphics(textAsShapes, gen) + : new PSGraphics2D(textAsShapes, gen); graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext()); AffineTransform transform = new AffineTransform(); // scale to viewbox diff --git a/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java b/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java index ed0b4e24a..f7f22020a 100644 --- a/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java +++ b/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java @@ -30,6 +30,7 @@ import org.apache.xmlgraphics.image.loader.Image; import org.apache.xmlgraphics.image.loader.ImageFlavor; import org.apache.xmlgraphics.image.loader.ImageInfo; import org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D; +import org.apache.xmlgraphics.java2d.GeneralGraphics2DImagePainter; import org.apache.xmlgraphics.java2d.Graphics2DImagePainter; import org.apache.xmlgraphics.java2d.ps.PSGraphics2D; import org.apache.xmlgraphics.ps.FormGenerator; @@ -84,7 +85,9 @@ public class PSImageHandlerGraphics2D implements PSImageHandler { gen.concatMatrix(sx, 0, 0, sy, fx, fy); final boolean textAsShapes = false; - PSGraphics2D graphics = new PSGraphics2D(textAsShapes, gen); + PSGraphics2D graphics = (painter instanceof GeneralGraphics2DImagePainter) + ? (PSGraphics2D) ((GeneralGraphics2DImagePainter) painter).getGraphics(textAsShapes, gen) + : new PSGraphics2D(textAsShapes, gen); graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext()); AffineTransform transform = new AffineTransform(); // scale to viewbox diff --git a/src/java/org/apache/fop/render/ps/PSImageUtils.java b/src/java/org/apache/fop/render/ps/PSImageUtils.java index e9d4ff27f..5f7aa7b79 100644 --- a/src/java/org/apache/fop/render/ps/PSImageUtils.java +++ b/src/java/org/apache/fop/render/ps/PSImageUtils.java @@ -48,6 +48,9 @@ public class PSImageUtils extends org.apache.xmlgraphics.ps.PSImageUtils { * @return true if the image shall be inlined, false if forms shall be used. */ public static boolean isImageInlined(ImageInfo info, PSRenderingContext renderingContext) { + if (info.getMimeType().equals("application/pdf")) { + return true; + } String uri = info.getOriginalURI(); if (uri == null || "".equals(uri)) { return true; -- 2.39.5