diff options
author | Jeremias Maerki <jeremias@apache.org> | 2010-06-11 12:31:45 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2010-06-11 12:31:45 +0000 |
commit | 1fae69d5fdafcf8ba313087e5afa67d203af6482 (patch) | |
tree | 71b270bd4c0433e935e33897448faf631ade0dd1 /src/java/org | |
parent | e3d79c1a636ec9a35082db9ea151b5953d3e9cad (diff) | |
download | xmlgraphics-fop-1fae69d5fdafcf8ba313087e5afa67d203af6482.tar.gz xmlgraphics-fop-1fae69d5fdafcf8ba313087e5afa67d203af6482.zip |
AFP Output: Fix for bitmap images inside an SVG or G2D graphic (printer errors) and positioning fix for bitmaps from G2D graphics.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@953684 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r-- | src/java/org/apache/fop/afp/AFPGraphics2D.java | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/java/org/apache/fop/afp/AFPGraphics2D.java b/src/java/org/apache/fop/afp/AFPGraphics2D.java index fdfde8cca..b8d7158cf 100644 --- a/src/java/org/apache/fop/afp/AFPGraphics2D.java +++ b/src/java/org/apache/fop/afp/AFPGraphics2D.java @@ -584,6 +584,10 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand int dataWidth = renderedImage.getWidth(); imageObjectInfo.setDataWidth(dataWidth); + int resolution = paintingState.getResolution(); + imageObjectInfo.setDataWidthRes(resolution); + imageObjectInfo.setDataHeightRes(resolution); + boolean colorImages = paintingState.isColorImages(); imageObjectInfo.setColor(colorImages); @@ -598,6 +602,10 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand ImageEncodingHelper.encodeRGBAsGrayScale( imageData, dataWidth, dataHeight, bitsPerPixel, boas); imageData = boas.toByteArray(); + if (bitsPerPixel == 1) { + //FS10 should generate a page seqment to avoid problems + imageObjectInfo.setCreatePageSegment(true); + } } imageObjectInfo.setData(imageData); @@ -612,7 +620,6 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand objectAreaInfo.setWidth(width); objectAreaInfo.setHeight(height); - int resolution = paintingState.getResolution(); objectAreaInfo.setWidthRes(resolution); objectAreaInfo.setHeightRes(resolution); @@ -667,23 +674,7 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand boolean drawn = drawBufferedImage(img, bufferedImage, width, height, observer); if (drawn) { - AffineTransform at = gc.getTransform(); - float[] srcPts = new float[] {x, y}; - float[] dstPts = new float[srcPts.length]; - at.transform(srcPts, 0, dstPts, 0, 1); - x = Math.round(dstPts[X]); - y = Math.round(dstPts[Y]); - try { - // get image object info - AFPImageObjectInfo imageObjectInfo - = createImageObjectInfo(bufferedImage, x, y, width, height); - - // create image resource - resourceManager.createObject(imageObjectInfo); - return true; - } catch (IOException ioe) { - handleIOException(ioe); - } + drawRenderedImage(bufferedImage, new AffineTransform()); } return false; } |