Author: jeremias
Date: Fri Jun 11 12:31:45 2010
New Revision: 953684
URL: http://svn.apache.org/viewvc?rev=953684&view=rev
Log:
AFP Output: Fix for bitmap images inside an SVG or G2D graphic (printer errors)
and positioning fix for bitmaps from G2D graphics.
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java
xmlgraphics/fop/trunk/status.xml
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java?rev=953684&r1=953683&r2=953684&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java Fri
Jun 11 12:31:45 2010
@@ -584,6 +584,10 @@ public class AFPGraphics2D extends Abstr
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 Abstr
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 Abstr
objectAreaInfo.setWidth(width);
objectAreaInfo.setHeight(height);
- int resolution = paintingState.getResolution();
objectAreaInfo.setWidthRes(resolution);
objectAreaInfo.setHeightRes(resolution);
@@ -667,23 +674,7 @@ public class AFPGraphics2D extends Abstr
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;
}
Modified: xmlgraphics/fop/trunk/status.xml
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=953684&r1=953683&r2=953684&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Fri Jun 11 12:31:45 2010
@@ -58,6 +58,10 @@
documents. Example: the fix of marks layering will be such a case when
it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Renderers" dev="JM" type="fix">
+ AFP Output: Fix for bitmap images inside an SVG or G2D graphic
(printer errors) and
+ positioning fix for bitmaps from G2D graphics.
+ </action>
<action context="Renderers" dev="JM" type="fix" fixes-bug="42306"
due-to="Richard Wheeldon">
Fix for AWT viewer to correctly track page numbers in continuous
display mode.
</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]