You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2008/07/24 11:37:16 UTC
svn commit: r679326 [24/33] - in /xmlgraphics/fop/trunk:
examples/embedding/java/embedding/ examples/embedding/java/embedding/events/
examples/embedding/java/embedding/intermediate/
examples/embedding/java/embedding/model/ examples/embedding/java/embed...
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java Thu Jul 24 02:35:34 2008
@@ -55,24 +55,24 @@
/** The ESC (escape) character */
public static final char ESC = '\033';
-
+
/** A list of all supported resolutions in PCL (values in dpi) */
public static final int[] PCL_RESOLUTIONS = new int[] {75, 100, 150, 200, 300, 600};
-
+
/** Selects a 4x4 Bayer dither matrix (17 grayscales) */
public static final int DITHER_MATRIX_4X4 = 4;
/** Selects a 8x8 Bayer dither matrix (65 grayscales) */
public static final int DITHER_MATRIX_8X8 = 8;
-
- private final DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
+
+ private final DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
private final DecimalFormat df2 = new DecimalFormat("0.##", symbols);
private final DecimalFormat df4 = new DecimalFormat("0.####", symbols);
-
+
private OutputStream out;
-
+
private boolean currentSourceTransparency = true;
private boolean currentPatternTransparency = true;
-
+
private int maxBitmapResolution = PCL_RESOLUTIONS[PCL_RESOLUTIONS.length - 1];
/**
@@ -80,7 +80,7 @@
* to create custom dither patterns for better grayscale quality.
*/
private boolean usePCLShades = false;
-
+
/**
* Main constructor.
* @param out the OutputStream to write the PCL stream to
@@ -88,7 +88,7 @@
public PCLGenerator(OutputStream out) {
this.out = out;
}
-
+
/**
* Main constructor.
* @param out the OutputStream to write the PCL stream to
@@ -108,17 +108,17 @@
}
this.maxBitmapResolution = maxResolution;
}
-
+
/** @return the OutputStream that this generator writes to */
public OutputStream getOutputStream() {
return this.out;
}
-
+
/** @return the maximum resolution to encode bitmap images at */
public int getMaximumBitmapResolution() {
return this.maxBitmapResolution;
}
-
+
/**
* Writes a PCL escape command to the output stream.
* @param cmd the command (without the ESCAPE character)
@@ -128,7 +128,7 @@
out.write(27); //ESC
out.write(cmd.getBytes("US-ASCII"));
}
-
+
/**
* Writes raw text (in ISO-8859-1 encoding) to the output stream.
* @param s the text
@@ -140,7 +140,7 @@
/**
* Formats a double value with two decimal positions for PCL output.
- *
+ *
* @param value value to format
* @return the formatted value
*/
@@ -150,7 +150,7 @@
/**
* Formats a double value with four decimal positions for PCL output.
- *
+ *
* @param value value to format
* @return the formatted value
*/
@@ -165,7 +165,7 @@
public void universalEndOfLanguage() throws IOException {
writeCommand("%-12345X");
}
-
+
/**
* Resets the printer and restores the user default environment.
* @throws IOException In case of an I/O error
@@ -173,7 +173,7 @@
public void resetPrinter() throws IOException {
writeCommand("E");
}
-
+
/**
* Sends the job separation command.
* @throws IOException In case of an I/O error
@@ -181,7 +181,7 @@
public void separateJobs() throws IOException {
writeCommand("&l1T");
}
-
+
/**
* Sends the form feed character.
* @throws IOException In case of an I/O error
@@ -198,7 +198,7 @@
public void setUnitOfMeasure(int value) throws IOException {
writeCommand("&u" + value + "D");
}
-
+
/**
* Sets the raster graphics resolution
* @param value the resolution value (units per inch)
@@ -207,7 +207,7 @@
public void setRasterGraphicsResolution(int value) throws IOException {
writeCommand("*t" + value + "R");
}
-
+
/**
* Selects the page size.
* @param selector the integer representing the page size
@@ -218,7 +218,7 @@
}
/**
- * Selects the paper source. The parameter is usually printer-specific. Usually, "1" is the
+ * Selects the paper source. The parameter is usually printer-specific. Usually, "1" is the
* default tray, "2" is the manual paper feed, "3" is the manual envelope feed, "4" is the
* "lower" tray and "7" is "auto-select". Consult the technical reference for your printer
* for all available values.
@@ -230,8 +230,8 @@
}
/**
- * Selects the duplexing mode for the page.
- * The parameter is usually printer-specific.
+ * Selects the duplexing mode for the page.
+ * The parameter is usually printer-specific.
* "0" means Simplex,
* "1" means Duplex, Long-Edge Binding,
* "2" means Duplex, Short-Edge Binding.
@@ -249,7 +249,7 @@
public void clearHorizontalMargins() throws IOException {
writeCommand("9");
}
-
+
/**
* The Top Margin command designates the number of lines between
* the top of the logical page and the top of the text area.
@@ -303,7 +303,7 @@
public void pushCursorPos() throws IOException {
writeCommand("&f0S");
}
-
+
/**
* Pops the current cursor position from the stack.
* @throws IOException In case of an I/O error
@@ -311,7 +311,7 @@
public void popCursorPos() throws IOException {
writeCommand("&f1S");
}
-
+
/**
* Changes the current print direction while maintaining the current cursor position.
* @param rotate the rotation angle (counterclockwise), one of 0, 90, 180 and 270.
@@ -320,10 +320,10 @@
public void changePrintDirection(int rotate) throws IOException {
writeCommand("&a" + rotate + "P");
}
-
+
/**
* Enters the HP GL/2 mode.
- * @param restorePreviousHPGL2Cursor true if the previous HP GL/2 pen position should be
+ * @param restorePreviousHPGL2Cursor true if the previous HP GL/2 pen position should be
* restored, false if the current position is maintained
* @throws IOException In case of an I/O error
*/
@@ -334,7 +334,7 @@
writeCommand("%1B");
}
}
-
+
/**
* Enters the PCL mode.
* @param restorePreviousPCLCursor true if the previous PCL cursor position should be restored,
@@ -348,7 +348,7 @@
writeCommand("%1A");
}
}
-
+
/**
* Generate a filled rectangle at the current cursor position.
*
@@ -367,10 +367,10 @@
//y += h;
}
setPatternTransparencyMode(false);
- if (usePCLShades
+ if (usePCLShades
|| Color.black.equals(col)
|| Color.white.equals(col)) {
- writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ formatDouble4(h / 100.0) + "V");
int lineshade = convertToPCLShade(col);
writeCommand("*c" + lineshade + "G");
@@ -378,7 +378,7 @@
} else {
defineGrayscalePattern(col, 32, DITHER_MATRIX_4X4);
- writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ formatDouble4(h / 100.0) + "V");
writeCommand("*c32G");
writeCommand("*c4P"); //User-defined pattern
@@ -391,19 +391,19 @@
private static final int[] BAYER_D2 = new int[] {0, 2, 3, 1};
private static final int[] BAYER_D4;
private static final int[] BAYER_D8;
-
+
static {
BAYER_D4 = deriveBayerMatrix(BAYER_D2);
BAYER_D8 = deriveBayerMatrix(BAYER_D4);
}
-
+
private static void setValueInMatrix(int[] dn, int half, int part, int idx, int value) {
int xoff = (part & 1) * half;
int yoff = (part & 2) * half * half;
int matrixIndex = yoff + ((int)(idx / half) * half * 2) + (idx % half) + xoff;
dn[matrixIndex] = value;
}
-
+
private static int[] deriveBayerMatrix(int[] d) {
int[] dn = new int[d.length * 4];
int half = (int)Math.sqrt(d.length);
@@ -414,7 +414,7 @@
}
return dn;
}
-
+
/**
* Generates a user-defined pattern for a dithering pattern matching the grayscale value
* of the color given.
@@ -423,7 +423,7 @@
* @param ditherMatrixSize the size of the Bayer dither matrix to use (4 or 8 supported)
* @throws IOException In case of an I/O error
*/
- public void defineGrayscalePattern(Color col, int patternID, int ditherMatrixSize)
+ public void defineGrayscalePattern(Color col, int patternID, int ditherMatrixSize)
throws IOException {
ByteArrayOutputStream baout = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream(baout);
@@ -436,36 +436,36 @@
//data.writeShort(600); //X Resolution (didn't manage to get that to work)
//data.writeShort(600); //Y Resolution
int gray255 = convertToGray(col.getRed(), col.getGreen(), col.getBlue());
-
+
byte[] pattern;
if (ditherMatrixSize == 8) {
int gray65 = gray255 * 65 / 255;
-
+
pattern = new byte[BAYER_D8.length / 8];
-
+
for (int i = 0, c = BAYER_D8.length; i < c; i++) {
boolean dot = !(BAYER_D8[i] < gray65 - 1);
if (dot) {
int byteIdx = i / 8;
- pattern[byteIdx] |= 1 << (i % 8);
+ pattern[byteIdx] |= 1 << (i % 8);
}
}
} else {
int gray17 = gray255 * 17 / 255;
-
- //Since a 4x4 pattern did not work, the 4x4 pattern is applied 4 times to an
- //8x8 pattern. Maybe this could be changed to use an 8x8 bayer dither pattern
+
+ //Since a 4x4 pattern did not work, the 4x4 pattern is applied 4 times to an
+ //8x8 pattern. Maybe this could be changed to use an 8x8 bayer dither pattern
//instead of the 4x4 one.
pattern = new byte[BAYER_D4.length / 8 * 4];
-
+
for (int i = 0, c = BAYER_D4.length; i < c; i++) {
boolean dot = !(BAYER_D4[i] < gray17 - 1);
if (dot) {
int byteIdx = i / 4;
- pattern[byteIdx] |= 1 << (i % 4);
- pattern[byteIdx] |= 1 << ((i % 4) + 4);
- pattern[byteIdx + 4] |= 1 << (i % 4);
- pattern[byteIdx + 4] |= 1 << ((i % 4) + 4);
+ pattern[byteIdx] |= 1 << (i % 4);
+ pattern[byteIdx] |= 1 << ((i % 4) + 4);
+ pattern[byteIdx + 4] |= 1 << (i % 4);
+ pattern[byteIdx + 4] |= 1 << ((i % 4) + 4);
}
}
}
@@ -525,7 +525,7 @@
public final int convertToGray(int r, int g, int b) {
return (r * 30 + g * 59 + b * 11) / 100;
}
-
+
/**
* Convert a Color value to a PCL shade value (0-100).
* @param col the color
@@ -535,7 +535,7 @@
float gray = convertToGray(col.getRed(), col.getGreen(), col.getBlue()) / 255f;
return (int)(100 - (gray * 100f));
}
-
+
/**
* Selects the current grayscale color (the given color is converted to grayscales).
* @param col the color
@@ -555,7 +555,7 @@
}
}
}
-
+
/**
* Select the current pattern
* @param patternID the pattern ID (<ESC>*c#G command)
@@ -583,7 +583,7 @@
return false;
}
}
-
+
/**
* Indicates whether an image is a grayscale image.
* @param img the image
@@ -592,7 +592,7 @@
public static boolean isGrayscaleImage(RenderedImage img) {
return (img.getColorModel().getColorSpace().getNumComponents() == 1);
}
-
+
private MonochromeBitmapConverter createMonochromeBitmapConverter() {
MonochromeBitmapConverter converter = null;
try {
@@ -621,7 +621,7 @@
private int calculatePCLResolution(int resolution) {
return calculatePCLResolution(resolution, false);
}
-
+
/**
* Calculates the ideal PCL resolution for a given resolution.
* @param resolution the input resolution
@@ -653,35 +653,35 @@
}
return PCL_RESOLUTIONS[choice];
}
-
+
private boolean isValidPCLResolution(int resolution) {
return resolution == calculatePCLResolution(resolution);
}
-
- private Dimension getAdjustedDimension(Dimension orgDim, double orgResolution,
+
+ private Dimension getAdjustedDimension(Dimension orgDim, double orgResolution,
int pclResolution) {
if (orgResolution == pclResolution) {
return orgDim;
} else {
Dimension result = new Dimension();
- result.width = (int)Math.round((double)orgDim.width * pclResolution / orgResolution);
- result.height = (int)Math.round((double)orgDim.height * pclResolution / orgResolution);
+ result.width = (int)Math.round((double)orgDim.width * pclResolution / orgResolution);
+ result.height = (int)Math.round((double)orgDim.height * pclResolution / orgResolution);
return result;
}
}
-
+
//Threshold table to convert an alpha channel (8-bit) into a clip mask (1-bit)
private static final byte[] THRESHOLD_TABLE = new byte[256];
static { // Initialize the arrays
for (int i = 0; i < 256; i++) {
THRESHOLD_TABLE[i] = (byte) ((i < 240) ? 255 : 0);
}
- }
-
+ }
+
private RenderedImage getMask(RenderedImage img, Dimension targetDim) {
- ColorModel cm = img.getColorModel();
+ ColorModel cm = img.getColorModel();
if (cm.hasAlpha()) {
- BufferedImage alpha = new BufferedImage(img.getWidth(), img.getHeight(),
+ BufferedImage alpha = new BufferedImage(img.getWidth(), img.getHeight(),
BufferedImage.TYPE_BYTE_GRAY);
Raster raster = img.getData();
GraphicsUtil.copyBand(raster, cm.getNumColorComponents(), alpha.getRaster(), 0);
@@ -700,7 +700,7 @@
targetDim.width, targetDim.height, 1, 1, null);
mask = new BufferedImage(colorModel, wraster, false, null);
}
-
+
Graphics2D g2d = mask.createGraphics();
try {
AffineTransform at = new AffineTransform();
@@ -732,7 +732,7 @@
* @param sourceTransparency true if the background should not be erased
* @throws IOException In case of an I/O error
*/
- public void paintBitmap(RenderedImage img, Dimension targetDim, boolean sourceTransparency)
+ public void paintBitmap(RenderedImage img, Dimension targetDim, boolean sourceTransparency)
throws IOException {
double targetResolution = img.getWidth() / UnitConv.mpt2in(targetDim.width);
int resolution = (int)Math.round(targetResolution);
@@ -745,7 +745,7 @@
if (!monochrome) {
//Transparency mask disabled. Doesn't work reliably
final boolean transparencyDisabled = true;
- RenderedImage mask = (transparencyDisabled ? null : getMask(img, effDim));
+ RenderedImage mask = (transparencyDisabled ? null : getMask(img, effDim));
if (mask != null) {
pushCursorPos();
selectCurrentPattern(0, 1); //Solid white
@@ -753,11 +753,11 @@
paintMonochromeBitmap(mask, effResolution);
popCursorPos();
}
-
+
BufferedImage src = null;
if (img instanceof BufferedImage && !scaled) {
if (!isGrayscaleImage(img) || img.getColorModel().hasAlpha()) {
- src = new BufferedImage(effDim.width, effDim.height,
+ src = new BufferedImage(effDim.width, effDim.height,
BufferedImage.TYPE_BYTE_GRAY);
ColorConvertOp op = new ColorConvertOp(
ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
@@ -767,7 +767,7 @@
}
}
if (src == null) {
- src = new BufferedImage(effDim.width, effDim.height,
+ src = new BufferedImage(effDim.width, effDim.height,
BufferedImage.TYPE_BYTE_GRAY);
Graphics2D g2d = src.createGraphics();
try {
@@ -784,7 +784,7 @@
converter.setHint("quality", "false");
BufferedImage buf = (BufferedImage)converter.convertToMonochrome(src);
-
+
RenderedImage red = buf;
selectCurrentPattern(0, 0); //Solid black
setTransparencyMode(sourceTransparency || mask != null, true);
@@ -793,7 +793,7 @@
//TODO untested!
RenderedImage effImg = img;
if (scaled) {
- BufferedImage buf = new BufferedImage(effDim.width, effDim.height,
+ BufferedImage buf = new BufferedImage(effDim.width, effDim.height,
BufferedImage.TYPE_BYTE_BINARY);
Graphics2D g2d = buf.createGraphics();
try {
@@ -831,7 +831,7 @@
if (!monochrome) {
throw new IllegalArgumentException("img must be a monochrome image");
}
-
+
int x = 0;
int y = 0;
int imgw = img.getWidth();
@@ -856,7 +856,7 @@
if ((sample == 0)) {
ib |= (1 << (7 - (x % 8)));
}
-
+
//RLE encoding
if ((x % 8) == 7 || ((x + 1) == imgw)) {
if (rlewidth < bytewidth) {
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGraphics2D.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGraphics2D.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGraphics2D.java Thu Jul 24 02:35:34 2008
@@ -54,10 +54,10 @@
/** The PCL generator */
protected PCLGenerator gen;
-
+
private boolean failOnUnsupportedFeature = true;
private boolean clippingDisabled = false;
-
+
/**
* Create a new PCLGraphics2D.
* @param gen the PCL Generator to paint with
@@ -103,7 +103,7 @@
public void setClippingDisabled(boolean value) {
this.clippingDisabled = value;
}
-
+
/**
* Central handler for IOExceptions for this class.
* @param ioe IOException to handle
@@ -124,7 +124,7 @@
throw new UnsupportedOperationException(msg);
}
}
-
+
/** {@inheritDoc} */
public GraphicsConfiguration getDeviceConfiguration() {
return GraphicsEnvironment.getLocalGraphicsEnvironment().
@@ -142,7 +142,7 @@
float[] da = bs.getDashArray();
if (da != null) {
-
+
gen.writeText("UL1,");
int len = Math.min(20, da.length);
float patternLen = 0.0f;
@@ -161,7 +161,7 @@
}
if (len == 1) {
gen.writeText("," + gen.formatDouble2(da[0] * 100 / patternLen ));
-
+
}
gen.writeText(";");
/* TODO Dash phase NYI
@@ -209,7 +209,7 @@
float ml = bs.getMiterLimit();
gen.writeText(",3" + gen.formatDouble4(ml));
-
+
float lw = bs.getLineWidth();
Point2D ptSrc = new Point2D.Double(lw, 0);
//Pen widths are set as absolute metric values (WU0;)
@@ -217,7 +217,7 @@
double transDist = UnitConv.pt2mm(ptDest.distance(0, 0));
//System.out.println("--" + ptDest.distance(0, 0) + " " + transDist);
gen.writeText(";PW" + gen.formatDouble4(transDist) + ";");
-
+
} else {
handleUnsupportedFeature("Unsupported Stroke: " + stroke.getClass().getName());
}
@@ -246,7 +246,7 @@
//gen.writeText("IW;");
} else {
handleUnsupportedFeature("Clipping is not supported. Shape: " + imclip);
- /* This is an attempt to clip using the "InputWindow" (IW) but this only allows to
+ /* This is an attempt to clip using the "InputWindow" (IW) but this only allows to
* clip a rectangular area. Force falling back to bitmap mode for now.
Rectangle2D bounds = imclip.getBounds2D();
Point2D p1 = new Point2D.Double(bounds.getX(), bounds.getY());
@@ -266,16 +266,16 @@
public void draw(Shape s) {
try {
AffineTransform trans = getTransform();
-
+
Shape imclip = getClip();
writeClip(imclip);
-
+
if (!Color.black.equals(getColor())) {
//TODO PCL 5 doesn't support colored pens, PCL5c has a pen color (PC) command
handleUnsupportedFeature("Only black is supported as stroke color: " + getColor());
}
applyStroke(getStroke());
-
+
PathIterator iter = s.getPathIterator(trans);
processPathIteratorStroke(iter);
writeClip(null);
@@ -290,7 +290,7 @@
AffineTransform trans = getTransform();
Shape imclip = getClip();
writeClip(imclip);
-
+
applyPaint(getPaint());
PathIterator iter = s.getPathIterator(trans);
@@ -371,7 +371,7 @@
sb.append("\n");
gen.writeText(sb.toString());
}
-
+
/**
* Processes a path iterator generating the nexessary painting operations.
* @param iter PathIterator to process
@@ -440,7 +440,7 @@
sb.append("\n");
gen.writeText(sb.toString());
}
-
+
private void fillPolygon(int windingRule, StringBuffer sb) {
int fillMethod = (windingRule == PathIterator.WIND_EVEN_ODD ? 0 : 1);
sb.append("FP").append(fillMethod).append(";");
@@ -461,16 +461,16 @@
sb.append(",").append(gen.formatDouble4(y3)).append(";");
}
- private void quadraticBezierAbsolute(double originX, double originY,
+ private void quadraticBezierAbsolute(double originX, double originY,
double x1, double y1, double x2, double y2, StringBuffer sb) {
//Quadratic Bezier curve can be mapped to a normal bezier curve
//See http://pfaedit.sourceforge.net/bezier.html
double nx1 = originX + (2.0 / 3.0) * (x1 - originX);
double ny1 = originY + (2.0 / 3.0) * (y1 - originY);
-
+
double nx2 = nx1 + (1.0 / 3.0) * (x2 - originX);
double ny2 = ny1 + (1.0 / 3.0) * (y2 - originY);
-
+
bezierAbsolute(nx1, ny1, nx2, ny2, x2, y2, sb);
}
@@ -554,7 +554,7 @@
at.transform(p1, p1);
pclContext.getTransform().transform(p1, p1);
gen.setCursorPos(p1.getX(), p1.getY());
- gen.paintBitmap(buf, 72);
+ gen.paintBitmap(buf, 72);
gen.enterHPGL2Mode(false);
} catch (IOException ioe) {
handleIOException(ioe);
@@ -596,7 +596,7 @@
return new BufferedImage(size.width, size.height,
BufferedImage.TYPE_BYTE_GRAY);
}
-
+
/** {@inheritDoc} */
public java.awt.FontMetrics getFontMetrics(java.awt.Font f) {
return fmg.getFontMetrics(f);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.pcl;
import java.awt.Dimension;
@@ -49,15 +49,15 @@
*/
public PCLGraphics2DAdapter() {
}
-
+
/** {@inheritDoc} */
- public void paintImage(Graphics2DImagePainter painter,
+ public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
PCLRendererContext pclContext = PCLRendererContext.wrapRendererContext(context);
PCLRenderer pcl = (PCLRenderer)context.getRenderer();
PCLGenerator gen = pcl.gen;
-
+
// get the 'width' and 'height' attributes of the image/document
Dimension dim = painter.getImageSize();
float imw = (float)dim.getWidth();
@@ -80,11 +80,11 @@
graphics.setClippingDisabled(pclContext.isClippingDisabled());
Rectangle2D area = new Rectangle2D.Double(0.0, 0.0, imw, imh);
painter.paint(graphics, area);
-
+
//If we arrive here, the graphic is natively paintable, so write the graphic
pcl.saveGraphicsState();
pcl.setCursorPos(x, y);
- gen.writeCommand("*c" + gen.formatDouble4(width / 100f) + "x"
+ gen.writeCommand("*c" + gen.formatDouble4(width / 100f) + "x"
+ gen.formatDouble4(height / 100f) + "Y");
gen.writeCommand("*c0T");
gen.enterHPGL2Mode(false);
@@ -92,7 +92,7 @@
gen.writeText("SP1;");
//One Plotter unit is 0.025mm!
double scale = imw / UnitConv.mm2pt(imw * 0.025);
- gen.writeText("SC0," + gen.formatDouble4(scale)
+ gen.writeText("SC0," + gen.formatDouble4(scale)
+ ",0,-" + gen.formatDouble4(scale) + ",2;");
gen.writeText("IR0,100,0,100;");
gen.writeText("PU;PA0,0;\n");
@@ -104,11 +104,11 @@
painted = true;
} catch (UnsupportedOperationException uoe) {
log.debug(
- "Cannot paint graphic natively. Falling back to bitmap painting. Reason: "
+ "Cannot paint graphic natively. Falling back to bitmap painting. Reason: "
+ uoe.getMessage());
}
}
-
+
if (!painted) {
//Fallback solution: Paint to a BufferedImage
int resolution = (int)Math.round(context.getUserAgent().getTargetResolution());
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLPageDefinition.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLPageDefinition.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLPageDefinition.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLPageDefinition.java Thu Jul 24 02:35:34 2008
@@ -33,17 +33,17 @@
private static List pageDefinitions;
private static PCLPageDefinition defaultPageDefinition;
-
+
private String name;
private int selector;
private Dimension physicalPageSize;
private Rectangle logicalPageRect;
private boolean landscape;
-
+
static {
createPageDefinitions();
}
-
+
/**
* Main constructor
* @param name the name of the page definition
@@ -52,7 +52,7 @@
* @param logicalPageRect the rectangle defining the logical page
* @param landscape true if it is a landscape format
*/
- public PCLPageDefinition(String name, int selector, Dimension physicalPageSize,
+ public PCLPageDefinition(String name, int selector, Dimension physicalPageSize,
Rectangle logicalPageRect, boolean landscape) {
this.name = name;
this.selector = selector;
@@ -60,17 +60,17 @@
this.logicalPageRect = logicalPageRect;
this.landscape = landscape;
}
-
+
/** @return the name of the page definition */
public String getName() {
return this.name;
}
-
+
/** @return the selector used by the <ESC>&l#A command (page size) */
public int getSelector() {
return this.selector;
}
-
+
/** @return true if it is a landscape format */
public boolean isLandscapeFormat() {
return this.landscape;
@@ -80,17 +80,17 @@
public Dimension getPhysicalPageSize() {
return this.physicalPageSize;
}
-
+
/** @return the rectangle defining the logical page */
public Rectangle getLogicalPageRect() {
return this.logicalPageRect;
}
-
+
private boolean matches(long width, long height, int errorMargin) {
- return (Math.abs(this.physicalPageSize.width - width) < errorMargin)
+ return (Math.abs(this.physicalPageSize.width - width) < errorMargin)
&& (Math.abs(this.physicalPageSize.height - height) < errorMargin);
}
-
+
/** {@inheritDoc} */
public String toString() {
return getName();
@@ -113,12 +113,12 @@
}
return null;
}
-
+
/** @return the default page definition (letter) */
public static PCLPageDefinition getDefaultPageDefinition() {
return defaultPageDefinition;
}
-
+
/**
* Converts an offset values for logical pages to millipoints. The values are given as pixels
* in a 300dpi environment.
@@ -128,34 +128,34 @@
private static int convert300dpiDotsToMpt(int offset) {
return (int)Math.round(((double)offset) * 72000 / 300);
}
-
+
private static Dimension createPhysicalPageSizeInch(float width, float height) {
return new Dimension(
- (int)Math.round(UnitConv.in2mpt(width)),
+ (int)Math.round(UnitConv.in2mpt(width)),
(int)Math.round(UnitConv.in2mpt(height)));
}
-
+
private static Dimension createPhysicalPageSizeMm(float width, float height) {
return new Dimension(
- (int)Math.round(UnitConv.mm2mpt(width)),
+ (int)Math.round(UnitConv.mm2mpt(width)),
(int)Math.round(UnitConv.mm2mpt(height)));
}
-
+
private static Rectangle createLogicalPageRect(int x, int y, int width, int height) {
- return new Rectangle(convert300dpiDotsToMpt(x), convert300dpiDotsToMpt(y),
+ return new Rectangle(convert300dpiDotsToMpt(x), convert300dpiDotsToMpt(y),
convert300dpiDotsToMpt(width), convert300dpiDotsToMpt(height));
}
-
+
private static void createPageDefinitions() {
pageDefinitions = new java.util.ArrayList();
pageDefinitions.add(new PCLPageDefinition("Letter", 2,
createPhysicalPageSizeInch(8.5f, 11),
createLogicalPageRect(75, 0, 2400, 3300), false));
- defaultPageDefinition = new PCLPageDefinition("Legal", 3,
+ defaultPageDefinition = new PCLPageDefinition("Legal", 3,
createPhysicalPageSizeInch(8.5f, 14),
createLogicalPageRect(75, 0, 2400, 4200), false);
pageDefinitions.add(defaultPageDefinition);
- pageDefinitions.add(new PCLPageDefinition("Executive", 1,
+ pageDefinitions.add(new PCLPageDefinition("Executive", 1,
createPhysicalPageSizeInch(7.25f, 10.5f),
createLogicalPageRect(75, 0, 2025, 3150), false));
pageDefinitions.add(new PCLPageDefinition("Ledger", 6,
@@ -164,19 +164,19 @@
pageDefinitions.add(new PCLPageDefinition("A4", 26,
createPhysicalPageSizeMm(210, 297),
createLogicalPageRect(71, 0, 2338, 3507), false));
- pageDefinitions.add(new PCLPageDefinition("A3", 27,
+ pageDefinitions.add(new PCLPageDefinition("A3", 27,
createPhysicalPageSizeMm(297, 420),
createLogicalPageRect(71, 0, 3365, 4960), false));
//TODO Add envelope definitions
-
+
pageDefinitions.add(new PCLPageDefinition("LetterL", 2,
createPhysicalPageSizeInch(11, 8.5f),
createLogicalPageRect(60, 0, 3180, 2550), true));
pageDefinitions.add(new PCLPageDefinition("LegalL", 3,
createPhysicalPageSizeInch(14, 8.5f),
createLogicalPageRect(60, 0, 4080, 2550), true));
- pageDefinitions.add(new PCLPageDefinition("ExecutiveL", 1,
+ pageDefinitions.add(new PCLPageDefinition("ExecutiveL", 1,
createPhysicalPageSizeInch(10.5f, 7.25f),
createLogicalPageRect(60, 0, 3030, 2175), true));
pageDefinitions.add(new PCLPageDefinition("LedgerL", 6,
@@ -189,5 +189,5 @@
createPhysicalPageSizeMm(420, 297),
createLogicalPageRect(59, 0, 4842, 3507), true));
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,10 +27,10 @@
import org.apache.fop.render.Renderer;
/**
- * PCL Renderer configurator
+ * PCL Renderer configurator
*/
public class PCLRendererConfigurator extends PrintRendererConfigurator {
-
+
/**
* Default constructor
* @param userAgent user agent
@@ -41,7 +41,7 @@
/**
* Configure the PCL renderer.
- *
+ *
* @param renderer PCL renderer
* @throws FOPException fop exception
*/
@@ -49,7 +49,7 @@
Configuration cfg = super.getRendererConfig(renderer);
if (cfg != null) {
PCLRenderer pclRenderer = (PCLRenderer)renderer;
-
+
String rendering = cfg.getChild("rendering").getValue(null);
if ("quality".equalsIgnoreCase(rendering)) {
pclRenderer.setQualityBeforeSpeed(true);
@@ -57,10 +57,10 @@
pclRenderer.setQualityBeforeSpeed(false);
} else if (rendering != null) {
throw new FOPException(
- "Valid values for 'rendering' are 'quality' and 'speed'. Value found: "
+ "Valid values for 'rendering' are 'quality' and 'speed'. Value found: "
+ rendering);
}
-
+
String textRendering = cfg.getChild("text-rendering").getValue(null);
if ("bitmap".equalsIgnoreCase(textRendering)) {
pclRenderer.setAllTextAsBitmaps(true);
@@ -68,10 +68,10 @@
pclRenderer.setAllTextAsBitmaps(false);
} else if (textRendering != null) {
throw new FOPException(
- "Valid values for 'text-rendering' are 'auto' and 'bitmap'. Value found: "
+ "Valid values for 'text-rendering' are 'auto' and 'bitmap'. Value found: "
+ textRendering);
}
-
+
pclRenderer.setPJLDisabled(cfg.getChild("disable-pjl").getValueAsBoolean(false));
}
super.configure(renderer);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererContext.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererContext.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererContext.java Thu Jul 24 02:35:34 2008
@@ -25,7 +25,7 @@
import org.apache.fop.render.RendererContext;
/**
- * Wrapper on the RendererContext to access the information structure for drawing
+ * Wrapper on the RendererContext to access the information structure for drawing
* the XML document.
*/
public class PCLRendererContext extends RendererContext.RendererContextWrapper {
@@ -48,18 +48,18 @@
public PCLRendererContext(RendererContext context) {
super(context);
}
-
+
/** @return true if the SVG image should be rendered as a bitmap */
public boolean paintAsBitmap() {
QName qName = new QName(ExtensionElementMapping.URI, null, "conversion-mode");
- return getForeignAttributes() != null
+ return getForeignAttributes() != null
&& "bitmap".equalsIgnoreCase((String)getForeignAttributes().get(qName));
}
-
+
/** @return true if clipping is disabled inside the PCLGraphics2D. */
public boolean isClippingDisabled() {
QName qName = new QName(ExtensionElementMapping.URI, null, "disable-clipping");
- return getForeignAttributes() != null
+ return getForeignAttributes() != null
&& "true".equalsIgnoreCase((String)getForeignAttributes().get(qName));
}
@@ -69,10 +69,10 @@
*/
public boolean isSourceTransparency() {
QName qName = new QName(ExtensionElementMapping.URI, null, "source-transparency");
- return getForeignAttributes() != null
+ return getForeignAttributes() != null
&& "true".equalsIgnoreCase((String)getForeignAttributes().get(qName));
}
-
+
/**
* Indicates whether an RGB canvas should be used rather than one with grayscales.
* This can be used to work around limitations of Apache Batik if you get error while
@@ -82,8 +82,8 @@
public boolean isColorCanvas() {
QName qName = new QName(ExtensionElementMapping.URI, null, "color-canvas");
Boolean prop = (Boolean)context.getProperty(PCLRendererContextConstants.PCL_COLOR_CANVAS);
- return Boolean.TRUE.equals(prop)
- || (getForeignAttributes() != null
+ return Boolean.TRUE.equals(prop)
+ || (getForeignAttributes() != null
&& "true".equalsIgnoreCase((String)getForeignAttributes().get(qName)));
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,7 @@
MimeConstants.MIME_PCL,
MimeConstants.MIME_PCL_ALT
};
-
+
/**{@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new PCLRenderer();
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLSVGHandler.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLSVGHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLSVGHandler.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,13 +36,13 @@
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof PCLRenderer);
}
-
+
/** {@inheritDoc} */
protected void updateRendererContext(RendererContext context) {
//Work around a problem in Batik: Gradients cannot be done in ColorSpace.CS_GRAY
context.setProperty(PCLRendererContextConstants.PCL_COLOR_CANVAS,
Boolean.TRUE);
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -48,7 +48,7 @@
private String key;
/** the image */
protected Image image;
-
+
private PDFICCStream pdfICCStream = null;
/**
@@ -77,7 +77,7 @@
protected ColorSpace getImageColorSpace() {
return image.getColorSpace();
}
-
+
/** {@inheritDoc} */
public void setup(PDFDocument doc) {
@@ -88,7 +88,7 @@
}
if (doc.getProfile().getPDFAMode().isPDFA1LevelB()) {
if (pdfCS != null
- && pdfCS.getColorSpace() != PDFDeviceColorSpace.DEVICE_RGB
+ && pdfCS.getColorSpace() != PDFDeviceColorSpace.DEVICE_RGB
&& pdfCS.getColorSpace() != PDFDeviceColorSpace.DEVICE_GRAY
&& prof == null) {
//See PDF/A-1, ISO 19005:1:2005(E), 6.2.3.3
@@ -107,7 +107,7 @@
protected ICC_Profile getEffectiveICCProfile() {
return image.getICCProfile();
}
-
+
private static PDFICCStream setupColorProfile(PDFDocument doc,
ICC_Profile prof, PDFDeviceColorSpace pdfCS) {
boolean defaultsRGB = ColorProfileUtil.isDefaultsRGB(prof);
@@ -154,32 +154,32 @@
public boolean isTransparent() {
return false;
}
-
+
/** {@inheritDoc} */
public PDFColor getTransparentColor() {
return null;
}
-
+
/** {@inheritDoc} */
public String getMask() {
return null;
}
-
+
/** {@inheritDoc} */
public String getSoftMask() {
return null;
}
-
+
/** {@inheritDoc} */
public PDFReference getSoftMaskReference() {
return null;
}
-
+
/** {@inheritDoc} */
public boolean isInverted() {
return false;
}
-
+
/** {@inheritDoc} */
public boolean isPS() {
return false;
@@ -194,7 +194,7 @@
public void populateXObjectDictionary(PDFDictionary dict) {
//nop
}
-
+
/**
* Converts a ColorSpace object to a PDFColorSpace object.
* @param cs ColorSpace instance
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/CTMHelper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/CTMHelper.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/CTMHelper.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/CTMHelper.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.pdf;
import java.awt.geom.AffineTransform;
@@ -37,7 +37,7 @@
* <p>Converts the sourceMatrix to a string for use in the PDFRenderer cm operations.</p>
* <p>For example:
* <pre>
- * org.apache.fop.area.CTM ctm =
+ * org.apache.fop.area.CTM ctm =
* new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0);
* String pdfMatrix = org.apache.fop.render.pdf.CTMHelper.toPDFString(ctm);
* </pre>
@@ -58,7 +58,7 @@
}
/**
- * <p>Converts the AffineTransform instance to a string for use in the PDFRenderer
+ * <p>Converts the AffineTransform instance to a string for use in the PDFRenderer
* cm operations.</p>
*
* @param transform The matrix to convert.
@@ -83,21 +83,21 @@
}
private static String constructPDFArray(double[] matrix) {
- return PDFNumber.doubleOut(matrix[0], 8) + " "
- + PDFNumber.doubleOut(matrix[1], 8) + " "
- + PDFNumber.doubleOut(matrix[2], 8) + " "
- + PDFNumber.doubleOut(matrix[3], 8) + " "
- + PDFNumber.doubleOut(matrix[4], 8) + " "
+ return PDFNumber.doubleOut(matrix[0], 8) + " "
+ + PDFNumber.doubleOut(matrix[1], 8) + " "
+ + PDFNumber.doubleOut(matrix[2], 8) + " "
+ + PDFNumber.doubleOut(matrix[3], 8) + " "
+ + PDFNumber.doubleOut(matrix[4], 8) + " "
+ PDFNumber.doubleOut(matrix[5], 8);
}
-
+
/**
* <p>Creates a new CTM based in the sourceMatrix.</p>
* <p>For example:
* <pre>
- * org.apache.fop.area.CTM inCTM =
+ * org.apache.fop.area.CTM inCTM =
* new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0);
- * org.apache.fop.area.CTM outCTM =
+ * org.apache.fop.area.CTM outCTM =
* org.apache.fop.render.pdf.CTMHelper.toPDFCTM(ctm);
* </pre>
* will return a new CTM where a == 1.0, b == 0.0, c == 0.0, d == 1.0, e == 1.0 and f == 1.0.
@@ -121,7 +121,7 @@
* <p>Creates an array of six doubles from the source CTM.</p>
* <p>For example:
* <pre>
- * org.apache.fop.area.CTM inCTM =
+ * org.apache.fop.area.CTM inCTM =
* new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0);
* double matrix[] = org.apache.fop.render.pdf.CTMHelper.toPDFArray(ctm);
* </pre>
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -55,7 +55,7 @@
public ImageRawCCITTFax getImage() {
return ((ImageRawCCITTFax)this.image);
}
-
+
/** {@inheritDoc} */
public void setup(PDFDocument doc) {
pdfFilter = new CCFFilter();
@@ -95,7 +95,7 @@
public PDFFilter getPDFFilter() {
return pdfFilter;
}
-
+
/** {@inheritDoc} */
public void outputContents(OutputStream out) throws IOException {
getImage().writeTo(out);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -64,7 +64,7 @@
public ImageRawJPEG getImage() {
return ((ImageRawJPEG)this.image);
}
-
+
/** {@inheritDoc} */
public void setup(PDFDocument doc) {
pdfFilter = new DCTFilter();
@@ -88,12 +88,12 @@
public boolean isInverted() {
return getImage().isInverted();
}
-
+
/** {@inheritDoc} */
public PDFFilter getPDFFilter() {
return pdfFilter;
}
-
+
/** {@inheritDoc} */
public void outputContents(OutputStream out) throws IOException {
InputStream in = getImage().createInputStream();
@@ -101,7 +101,7 @@
try {
JPEGFile jpeg = new JPEGFile(in);
DataInput din = jpeg.getDataInput();
-
+
//Copy the whole JPEG file except:
// - the ICC profile
//TODO Thumbnails could safely be skipped, too.
@@ -149,7 +149,7 @@
default:
out.write(0xFF);
out.write(segID);
-
+
reclen = jpeg.readSegmentLength();
//write short
out.write((reclen >>> 8) & 0xFF);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,7 +52,7 @@
private static Log log = LogFactory.getLog(ImageRenderedAdapter.class);
private ImageEncodingHelper encodingHelper;
-
+
private PDFFilter pdfFilter = null;
private String maskRef;
private PDFReference softMask;
@@ -74,11 +74,11 @@
public ImageRendered getImage() {
return ((ImageRendered)this.image);
}
-
+
private ColorModel getEffectiveColorModel() {
return encodingHelper.getEncodedColorModel();
}
-
+
/** {@inheritDoc} */
protected ColorSpace getImageColorSpace() {
return getEffectiveColorModel().getColorSpace();
@@ -90,14 +90,14 @@
ColorModel cm = getEffectiveColorModel();
super.setup(doc);
-
+
//Handle transparency mask if applicable
- ColorModel orgcm = ri.getColorModel();
+ ColorModel orgcm = ri.getColorModel();
if (orgcm.hasAlpha() && orgcm.getTransparency() == ColorModel.TRANSLUCENT) {
doc.getProfile().verifyTransparencyAllowed(image.getInfo().getOriginalURI());
//TODO Implement code to combine image with background color if transparency is not
//allowed (need BufferedImage support for that)
-
+
AlphaRasterImage alphaImage = new AlphaRasterImage("Mask:" + getKey(), ri);
this.softMask = doc.addImage(null, alphaImage).makeReference();
}
@@ -130,7 +130,7 @@
}
return (getImage().getTransparentColor() != null);
}
-
+
private static Integer getIndexOfFirstTransparentColorInPalette(RenderedImage image) {
ColorModel cm = image.getColorModel();
if (cm instanceof IndexColorModel) {
@@ -180,19 +180,19 @@
public PDFReference getSoftMaskReference() {
return softMask;
}
-
+
/** {@inheritDoc} */
public PDFFilter getPDFFilter() {
return pdfFilter;
}
-
+
/** {@inheritDoc} */
public void outputContents(OutputStream out) throws IOException {
encodingHelper.encode(out);
}
private static final int MAX_HIVAL = 255;
-
+
/** {@inheritDoc} */
public void populateXObjectDictionary(PDFDictionary dict) {
ColorModel cm = getEffectiveColorModel();
@@ -200,11 +200,11 @@
IndexColorModel icm = (IndexColorModel)cm;
PDFArray indexed = new PDFArray(dict);
indexed.add(new PDFName("Indexed"));
-
+
if (icm.getColorSpace().getType() != ColorSpace.TYPE_RGB) {
log.warn("Indexed color space is not using RGB as base color space."
+ " The image may not be handled correctly."
- + " Base color space: " + icm.getColorSpace()
+ + " Base color space: " + icm.getColorSpace()
+ " Image: " + image.getInfo());
}
indexed.add(new PDFName(toPDFColorSpace(icm.getColorSpace()).getName()));
@@ -229,7 +229,7 @@
dict.put("ColorSpace", indexed);
dict.put("BitsPerComponent", icm.getPixelSize());
-
+
Integer index = getIndexOfFirstTransparentColorInPalette(getImage().getRenderedImage());
if (index != null) {
PDFArray mask = new PDFArray(dict);
@@ -239,7 +239,7 @@
}
}
}
-
+
/** {@inheritDoc} */
public String getFilterHint() {
return PDFFilterList.IMAGE_FILTER;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFEventProducer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFEventProducer.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFEventProducer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFEventProducer.java Thu Jul 24 02:35:34 2008
@@ -31,7 +31,7 @@
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -50,9 +50,9 @@
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* Some link targets haven't been fully resolved.
* @param source the event source
@@ -60,5 +60,5 @@
* @event.severity WARN
*/
void nonFullyResolvedLinkTargets(Object source, int count);
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.pdf;
import java.awt.Color;
@@ -49,18 +49,18 @@
public PDFGraphics2DAdapter(PDFRenderer renderer) {
this.renderer = renderer;
}
-
+
/** {@inheritDoc} */
public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
-
+
PDFSVGHandler.PDFInfo pdfInfo = PDFSVGHandler.getPDFInfo(context);
float fwidth = width / 1000f;
float fheight = height / 1000f;
float fx = x / 1000f;
float fy = y / 1000f;
-
+
// get the 'width' and 'height' attributes of the SVG document
Dimension dim = painter.getImageSize();
float imw = (float)dim.getWidth() / 1000f;
@@ -72,7 +72,7 @@
renderer.saveGraphicsState();
renderer.setColor(Color.black, false, null);
renderer.setColor(Color.black, true, null);
-
+
//TODO Clip to the image area.
// transform so that the coordinates (0,0) is from the top left
@@ -86,13 +86,13 @@
if (pdfInfo.pdfContext == null) {
pdfInfo.pdfContext = pdfInfo.pdfPage;
}
- PDFGraphics2D graphics = new PDFGraphics2D(textAsShapes,
+ PDFGraphics2D graphics = new PDFGraphics2D(textAsShapes,
pdfInfo.fi, pdfInfo.pdfDoc,
pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
pdfInfo.currentFontName,
pdfInfo.currentFontSize);
graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
-
+
AffineTransform transform = new AffineTransform();
transform.translate(fx, fy);
pdfInfo.pdfState.concatenate(transform);
@@ -105,7 +105,7 @@
RendererContextWrapper ctx = RendererContext.wrapRendererContext(context);
BufferedImage bi = paintToBufferedImage(painter, ctx, resolution, false, false);
- float scale = PDFRenderer.NORMAL_PDF_RESOLUTION
+ float scale = PDFRenderer.NORMAL_PDF_RESOLUTION
/ context.getUserAgent().getTargetResolution();
graphics.drawImage(bi, new AffineTransform(scale, 0, 0, scale, 0, 0), null);
} else {
@@ -121,9 +121,9 @@
/** {@inheritDoc} */
protected void setRenderingHintsForBufferedImage(Graphics2D g2d) {
super.setRenderingHintsForBufferedImage(g2d);
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+ g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandler.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandler.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -41,19 +41,19 @@
* @return a positive integer (>0) indicating the priority
*/
int getPriority();
-
+
/**
* Returns the {@link ImageFlavor}s supported by this instance
* @return the supported image flavors
*/
ImageFlavor[] getSupportedImageFlavors();
-
+
/**
* Returns the {@link Image} subclass supported by this instance.
* @return the Image type
*/
Class getSupportedImageClass();
-
+
/**
* Generates the PDF objects for the given {@link Image} instance. If the handler generates
* an XObject, it shall return it or otherwise return null. A generated XObject shall be
@@ -66,7 +66,7 @@
* @return the generated XObject or null if no XObject was generated
* @throws IOException if an I/O error occurs
*/
- PDFXObject generateImage(RendererContext context, Image image,
+ PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos) throws IOException;
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java Thu Jul 24 02:35:34 2008
@@ -38,9 +38,9 @@
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.GRAPHICS2D,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java Thu Jul 24 02:35:34 2008
@@ -41,9 +41,9 @@
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.RAW_CCITTFAX,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
@@ -52,7 +52,7 @@
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
-
+
PDFImage pdfimage = new ImageRawCCITTFaxAdapter(ccitt, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
@@ -61,7 +61,7 @@
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;
renderer.placeImage(x, y, w, h, xobj);
-
+
return xobj;
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java Thu Jul 24 02:35:34 2008
@@ -41,9 +41,9 @@
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.RAW_JPEG,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
@@ -52,7 +52,7 @@
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
-
+
PDFImage pdfimage = new ImageRawJPEGAdapter(jpeg, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
@@ -61,7 +61,7 @@
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;
renderer.placeImage(x, y, w, h, xobj);
-
+
return xobj;
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -41,7 +41,7 @@
/** the logger */
private static Log log = LogFactory.getLog(PDFImageHandlerRegistry.class);
-
+
private static final Comparator HANDLER_COMPARATOR = new Comparator() {
public int compare(Object o1, Object o2) {
PDFImageHandler h1 = (PDFImageHandler)o1;
@@ -54,19 +54,19 @@
private Map handlers = new java.util.HashMap();
/** List containing the same handlers as above but ordered by priority */
private List handlerList = new java.util.LinkedList();
-
+
/** Sorted Set of registered handlers */
private ImageFlavor[] supportedFlavors = new ImageFlavor[0];
private int handlerRegistrations;
private int lastSync;
-
+
/**
* Default constructor.
*/
public PDFImageHandlerRegistry() {
discoverHandlers();
}
-
+
/**
* Add an PDFImageHandler. The handler itself is inspected to find out what it supports.
* @param classname the fully qualified class name
@@ -87,11 +87,11 @@
+ classname);
} catch (ClassCastException e) {
throw new IllegalArgumentException(classname
- + " is not an "
+ + " is not an "
+ PDFImageHandler.class.getName());
}
}
-
+
/**
* Add an image handler. The handler itself is inspected to find out what it supports.
* @param handler the PDFImageHandler instance
@@ -99,7 +99,7 @@
public synchronized void addHandler(PDFImageHandler handler) {
Class imageClass = handler.getSupportedImageClass();
this.handlers.put(imageClass, handler);
-
+
//Sorted insert
ListIterator iter = this.handlerList.listIterator();
while (iter.hasNext()) {
@@ -112,7 +112,7 @@
iter.add(handler);
this.handlerRegistrations++;
}
-
+
/**
* Returns an PDFImageHandler which handles an specific image type given the MIME type
* of the image.
@@ -143,7 +143,7 @@
}
/**
- * Returns the ordered array of supported image flavors.
+ * Returns the ordered array of supported image flavors.
* @return the array of image flavors
*/
public synchronized ImageFlavor[] getSupportedFlavors() {
@@ -162,7 +162,7 @@
}
return this.supportedFlavors;
}
-
+
/**
* Discovers PDFImageHandler implementations through the classpath and dynamically
* registers them.
@@ -175,7 +175,7 @@
PDFImageHandler handler = (PDFImageHandler)providers.next();
try {
if (log.isDebugEnabled()) {
- log.debug("Dynamically adding PDFImageHandler: "
+ log.debug("Dynamically adding PDFImageHandler: "
+ handler.getClass().getName());
}
addHandler(handler);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java Thu Jul 24 02:35:34 2008
@@ -40,11 +40,11 @@
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE
+ ImageFlavor.RENDERED_IMAGE
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
@@ -53,7 +53,7 @@
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
-
+
PDFImage pdfimage = new ImageRenderedAdapter(imageRend, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
@@ -62,7 +62,7 @@
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;
renderer.placeImage(x, y, w, h, xobj);
-
+
return xobj;
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java Thu Jul 24 02:35:34 2008
@@ -41,9 +41,9 @@
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.XML_DOM,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org