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 je...@apache.org on 2008/03/06 14:34:59 UTC
svn commit: r634267 [14/39] - in
/xmlgraphics/fop/branches/Temp_ProcessingFeedback: ./ examples/embedding/
examples/embedding/java/embedding/
examples/embedding/java/embedding/intermediate/ examples/embedding/xml/xml/
examples/fo/ examples/fo/advanced/...
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/ObjectEnvironmentGroup.java Thu Mar 6 05:33:44 2008
@@ -18,7 +18,6 @@
/* $Id$ */
package org.apache.fop.render.afp.modca;
-
import java.io.IOException;
import java.io.OutputStream;
@@ -34,7 +33,7 @@
* normally contained in the object environment group, or it may specify that one or
* more default values are to be used.
*/
-public final class ObjectEnvironmentGroup extends AbstractStructuredAFPObject {
+public final class ObjectEnvironmentGroup extends AbstractNamedAFPObject {
/**
* Default name for the object environment group
@@ -57,15 +56,12 @@
private ImageDataDescriptor imageDataDescriptor = null;
/**
- * The GraphicsDataDescriptor for the object environment group
- */
- private GraphicsDataDescriptor graphicsDataDescriptor = null;
-
- /**
* Default constructor for the ObjectEnvironmentGroup.
*/
public ObjectEnvironmentGroup() {
+
this(DEFAULT_NAME);
+
}
/**
@@ -74,7 +70,9 @@
* @param name the object environment group name
*/
public ObjectEnvironmentGroup(String name) {
+
super(name);
+
}
/**
@@ -84,14 +82,15 @@
* @param width the object width
* @param height the object height
* @param rotation the object orientation
- * @param widthRes the object resolution width
- * @param heightRes the object resolution height
+ * @param widthResolution the object resolution width
+ * @param heightResolution the object resolution height
*/
- public void setObjectArea(int x, int y, int width, int height,
- int widthRes, int heightRes, int rotation) {
- this.objectAreaDescriptor = new ObjectAreaDescriptor(width, height,
- widthRes, heightRes);
- this.objectAreaPosition = new ObjectAreaPosition(x, y, rotation);
+ public void setObjectArea(int x, int y, int width, int height, int rotation,
+ int widthResolution, int heightResolution) {
+
+ objectAreaDescriptor = new ObjectAreaDescriptor(width, height,
+ widthResolution, heightResolution);
+ objectAreaPosition = new ObjectAreaPosition(x, y, rotation);
}
@@ -103,28 +102,40 @@
* @param height the image height
*/
public void setImageData(int xresol, int yresol, int width, int height) {
- this.imageDataDescriptor = new ImageDataDescriptor(xresol, yresol, width, height);
+ imageDataDescriptor = new ImageDataDescriptor(xresol, yresol, width, height);
}
/**
- * Set the graphics data descriptor.
- * @param xresol the x resolution of the graphics window
- * @param yresol the y resolution of the graphics window
- * @param xlwind the left edge of the graphics window
- * @param xrwind the right edge of the graphics window
- * @param ybwind the top edge of the graphics window
- * @param ytwind the bottom edge of the graphics window
+ * Accessor method to obtain write the AFP datastream for
+ * the object environment group.
+ * @param os The stream to write to
+ * @throws java.io.IOException throw if an I/O exception of some sort has occurred
*/
- public void setGraphicsData(int xresol, int yresol,
- int xlwind, int xrwind, int ybwind, int ytwind) {
- this.graphicsDataDescriptor = new GraphicsDataDescriptor(xresol, yresol,
- xlwind, xrwind, ybwind, ytwind);
+ public void writeDataStream(OutputStream os)
+ throws IOException {
+
+
+ writeStart(os);
+
+ objectAreaDescriptor.writeDataStream(os);
+
+ objectAreaPosition.writeDataStream(os);
+
+ if (imageDataDescriptor != null) {
+ imageDataDescriptor.writeDataStream(os);
+ }
+
+ writeEnd(os);
+
}
/**
- * {@inheritDoc}
+ * Helper method to write the start of the object environment group.
+ * @param os The stream to write to
*/
- protected void writeStart(OutputStream os) throws IOException {
+ private void writeStart(OutputStream os)
+ throws IOException {
+
byte[] data = new byte[] {
0x5A, // Structured field identifier
0x00, // Length byte 1
@@ -135,57 +146,53 @@
0x00, // Flags
0x00, // Reserved
0x00, // Reserved
- nameBytes[0], // Name
- nameBytes[1], //
- nameBytes[2], //
- nameBytes[3], //
- nameBytes[4], //
- nameBytes[5], //
- nameBytes[6], //
- nameBytes[7] //
+ 0x00, // Name
+ 0x00, //
+ 0x00, //
+ 0x00, //
+ 0x00, //
+ 0x00, //
+ 0x00, //
+ 0x00, //
};
+
+ for (int i = 0; i < nameBytes.length; i++) {
+
+ data[9 + i] = nameBytes[i];
+
+ }
+
os.write(data);
+
}
/**
- * {@inheritDoc}
+ * Helper method to write the end of the object environment group.
+ * @param os The stream to write to
*/
- public void writeContent(OutputStream os) throws IOException {
- objectAreaDescriptor.writeDataStream(os);
- objectAreaPosition.writeDataStream(os);
+ private void writeEnd(OutputStream os)
+ throws IOException {
- if (imageDataDescriptor != null) {
- imageDataDescriptor.writeDataStream(os);
- }
+ byte[] data = new byte[17];
+
+ data[0] = 0x5A; // Structured field identifier
+ data[1] = 0x00; // Length byte 1
+ data[2] = 0x10; // Length byte 2
+ data[3] = (byte) 0xD3; // Structured field id byte 1
+ data[4] = (byte) 0xA9; // Structured field id byte 2
+ data[5] = (byte) 0xC7; // Structured field id byte 3
+ data[6] = 0x00; // Flags
+ data[7] = 0x00; // Reserved
+ data[8] = 0x00; // Reserved
+
+ for (int i = 0; i < nameBytes.length; i++) {
+
+ data[9 + i] = nameBytes[i];
- if (graphicsDataDescriptor != null) {
- graphicsDataDescriptor.writeDataStream(os);
}
- }
- /**
- * {@inheritDoc}
- */
- protected void writeEnd(OutputStream os) throws IOException {
- byte[] data = new byte[] {
- 0x5A, // Structured field identifier
- 0x00, // Length byte 1
- 0x10, // Length byte 2
- (byte) 0xD3, // Structured field id byte 1
- (byte) 0xA9, // Structured field id byte 2
- (byte) 0xC7, // Structured field id byte 3
- 0x00, // Flags
- 0x00, // Reserved
- 0x00, // Reserved
- nameBytes[0], // Name
- nameBytes[1], //
- nameBytes[2], //
- nameBytes[3], //
- nameBytes[4], //
- nameBytes[5], //
- nameBytes[6], //
- nameBytes[7], //
- };
os.write(data);
+
}
-}
+
+}
\ No newline at end of file
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PageDescriptor.java Thu Mar 6 05:33:44 2008
@@ -35,11 +35,11 @@
* and page height.
* @param width The page width.
* @param height The page height.
- * @param widthRes The page width resolution
- * @param heightRes The page height resolution
+ * @param widthResolution The page width resolution
+ * @param heightResolution The page height resolution
*/
- public PageDescriptor(int width, int height, int widthRes, int heightRes) {
- super(width, height, widthRes, heightRes);
+ public PageDescriptor(int width, int height, int widthResolution, int heightResolution) {
+ super(width, height, widthResolution, heightResolution);
}
/**
@@ -68,12 +68,12 @@
data[10] = 0x00; // YpgBase = 10 inches
// XpgUnits
- byte[] xdpi = BinaryUtils.convert(widthRes * 10, 2);
+ byte[] xdpi = BinaryUtils.convert(widthResolution * 10, 2);
data[11] = xdpi[0];
data[12] = xdpi[1];
// YpgUnits
- byte[] ydpi = BinaryUtils.convert(heightRes * 10, 2);
+ byte[] ydpi = BinaryUtils.convert(heightResolution * 10, 2);
data[13] = ydpi[0];
data[14] = ydpi[1];
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PageObject.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PageObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PageObject.java Thu Mar 6 05:33:44 2008
@@ -62,15 +62,15 @@
* the height of the page.
* @param rotation
* the rotation of the page.
- * @param widthRes
+ * @param widthResolution
* the width resolution of the page.
- * @param heightRes
+ * @param heightResolution
* the height resolution of the page.
*/
public PageObject(String name, int width, int height, int rotation,
- int widthRes, int heightRes) {
+ int widthResolution, int heightResolution) {
- super(name, width, height, rotation, widthRes, heightRes);
+ super(name, width, height, rotation, widthResolution, heightResolution);
}
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java Thu Mar 6 05:33:44 2008
@@ -56,42 +56,42 @@
/**
* The afp data relating to this presentaion text data.
*/
- private ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ private ByteArrayOutputStream _baos = new ByteArrayOutputStream(1024);
/**
* The current x coordinate.
*/
- private int currentXCoordinate = -1;
+ private int _currentXCoordinate = -1;
/**
* The current y cooridnate
*/
- private int currentYCoordinate = -1;
+ private int _currentYCoordinate = -1;
/**
* The current font
*/
- private String currentFont = "";
+ private String _currentFont = "";
/**
* The current orientation
*/
- private int currentOrientation = 0;
+ private int _currentOrientation = 0;
/**
* The current color
*/
- private Color currentColor = new Color(0, 0, 0);
+ private Color _currentColor = new Color(0, 0, 0);
/**
* The current variable space increment
*/
- private int currentVariableSpaceCharacterIncrement = 0;
+ private int _currentVariableSpaceCharacterIncrement = 0;
/**
* The current inter character adjustment
*/
- private int currentInterCharacterAdjustment = 0;
+ private int _currentInterCharacterAdjustment = 0;
/**
* Default constructor for the PresentationTextData.
@@ -112,7 +112,7 @@
*/
public PresentationTextData(boolean controlInd) {
- baos.write(new byte[] {0x5A, // Structured field identifier
+ _baos.write(new byte[] { 0x5A, // Structured field identifier
0x00, // Record length byte 1
0x00, // Record length byte 2
(byte) 0xD3, // PresentationTextData identifier byte 1
@@ -124,7 +124,7 @@
}, 0, 9);
if (controlInd) {
- baos.write(new byte[] {0x2B, (byte) 0xD3}, 0, 2);
+ _baos.write(new byte[] { 0x2B, (byte) 0xD3 }, 0, 2);
}
}
@@ -142,13 +142,13 @@
private void setCodedFont(byte font, ByteArrayOutputStream afpdata) {
// Avoid unnecessary specification of the font
- if (String.valueOf(font).equals(currentFont)) {
+ if (String.valueOf(font).equals(_currentFont)) {
return;
} else {
- currentFont = String.valueOf(font);
+ _currentFont = String.valueOf(font);
}
- afpdata.write(new byte[] {0x03, (byte) 0xF1, font}, 0, 3);
+ afpdata.write(new byte[] { 0x03, (byte) 0xF1, font, }, 0, 3);
}
@@ -167,9 +167,9 @@
byte[] b = BinaryUtils.convert(coordinate, 2);
- afpdata.write(new byte[] {0x04, (byte) 0xC7, b[0], b[1]}, 0, 4);
+ afpdata.write(new byte[] { 0x04, (byte) 0xC7, b[0], b[1], }, 0, 4);
- currentXCoordinate = coordinate;
+ _currentXCoordinate = coordinate;
}
@@ -188,9 +188,9 @@
byte[] b = BinaryUtils.convert(coordinate, 2);
- afpdata.write(new byte[] {0x04, (byte) 0xD3, b[0], b[1]}, 0, 4);
+ afpdata.write(new byte[] { 0x04, (byte) 0xD3, b[0], b[1], }, 0, 4);
- currentYCoordinate = coordinate;
+ _currentYCoordinate = coordinate;
}
@@ -214,7 +214,7 @@
"Transparent data is longer than 253 bytes: " + data);
}
- afpdata.write(new byte[] {BinaryUtils.convert(l)[0], (byte) 0xDB},
+ afpdata.write(new byte[] { BinaryUtils.convert(l)[0], (byte) 0xDB, },
0, 2);
afpdata.write(data, 0, data.length);
@@ -236,7 +236,7 @@
private void drawBaxisRule(int length, int width,
ByteArrayOutputStream afpdata) {
- afpdata.write(new byte[] {0x07, // Length
+ afpdata.write(new byte[] { 0x07, // Length
(byte) 0xE7, // Type
}, 0, 2);
@@ -266,7 +266,7 @@
private void drawIaxisRule(int length, int width,
ByteArrayOutputStream afpdata) {
- afpdata.write(new byte[] {0x07, // Length
+ afpdata.write(new byte[] { 0x07, // Length
(byte) 0xE5, // Type
}, 0, 2);
@@ -284,7 +284,7 @@
/**
* Create the presentation text data for the byte array of data.
*
- * @param fontReference
+ * @param fontNumber
* The font resource identifier.
* @param x
* The x coordinate for the text data.
@@ -300,64 +300,64 @@
* The inter character adjustment.
* @param data
* The text data to be created.
- * @throws MaximumSizeExceededException if the maximum size is exceeded
+ * @throws MaximumSizeExceededException
*/
- public void createTextData(int fontReference, int x, int y, int orientation,
+ public void createTextData(int fontNumber, int x, int y, int orientation,
Color col, int vsci, int ica, byte[] data)
throws MaximumSizeExceededException {
ByteArrayOutputStream afpdata = new ByteArrayOutputStream();
- if (currentOrientation != orientation) {
+ if (_currentOrientation != orientation) {
setTextOrientation(orientation, afpdata);
- currentOrientation = orientation;
- currentXCoordinate = -1;
- currentYCoordinate = -1;
+ _currentOrientation = orientation;
+ _currentXCoordinate = -1;
+ _currentYCoordinate = -1;
}
// Avoid unnecessary specification of the Y co-ordinate
- if (y != currentYCoordinate) {
+ if (y != _currentYCoordinate) {
absoluteMoveBaseline(y, afpdata);
- currentXCoordinate = -1;
+ _currentXCoordinate = -1;
}
// Avoid unnecessary specification of the X co-ordinate
- if (x != currentXCoordinate) {
+ if (x != _currentXCoordinate) {
absoluteMoveInline(x, afpdata);
}
// Avoid unnecessary specification of the variable space increment
- if (vsci != currentVariableSpaceCharacterIncrement) {
+ if (vsci != _currentVariableSpaceCharacterIncrement) {
setVariableSpaceCharacterIncrement(vsci, afpdata);
- currentVariableSpaceCharacterIncrement = vsci;
+ _currentVariableSpaceCharacterIncrement = vsci;
}
// Avoid unnecessary specification of the inter character adjustment
- if (ica != currentInterCharacterAdjustment) {
+ if (ica != _currentInterCharacterAdjustment) {
setInterCharacterAdjustment(ica, afpdata);
- currentInterCharacterAdjustment = ica;
+ _currentInterCharacterAdjustment = ica;
}
// Avoid unnecessary specification of the text color
- if (!col.equals(currentColor)) {
+ if (!col.equals(_currentColor)) {
setExtendedTextColor(col, afpdata);
- currentColor = col;
+ _currentColor = col;
}
- setCodedFont(BinaryUtils.convert(fontReference)[0], afpdata);
+ setCodedFont(BinaryUtils.convert(fontNumber)[0], afpdata);
addTransparentData(data, afpdata);
- currentXCoordinate = -1;
+ _currentXCoordinate = -1;
int s = afpdata.size();
- if (baos.size() + s > MAX_SIZE) {
- currentXCoordinate = -1;
- currentYCoordinate = -1;
+ if (_baos.size() + s > MAX_SIZE) {
+ _currentXCoordinate = -1;
+ _currentYCoordinate = -1;
throw new MaximumSizeExceededException();
}
byte[] outputdata = afpdata.toByteArray();
- baos.write(outputdata, 0, outputdata.length);
+ _baos.write(outputdata, 0, outputdata.length);
}
@@ -379,31 +379,30 @@
* The orientation of the text data.
* @param col
* The text color.
- * @throws MaximumSizeExceededException if the maximum size is exceeded
*/
public void createLineData(int x1, int y1, int x2, int y2, int thickness,
int orientation, Color col) throws MaximumSizeExceededException {
ByteArrayOutputStream afpdata = new ByteArrayOutputStream();
- if (currentOrientation != orientation) {
+ if (_currentOrientation != orientation) {
setTextOrientation(orientation, afpdata);
- currentOrientation = orientation;
+ _currentOrientation = orientation;
}
// Avoid unnecessary specification of the Y coordinate
- if (y1 != currentYCoordinate) {
+ if (y1 != _currentYCoordinate) {
absoluteMoveBaseline(y1, afpdata);
}
// Avoid unnecessary specification of the X coordinate
- if (x1 != currentXCoordinate) {
+ if (x1 != _currentXCoordinate) {
absoluteMoveInline(x1, afpdata);
}
- if (!col.equals(currentColor)) {
+ if (!col.equals(_currentColor)) {
setExtendedTextColor(col, afpdata);
- currentColor = col;
+ _currentColor = col;
}
if (y1 == y2) {
@@ -416,14 +415,14 @@
int s = afpdata.size();
- if (baos.size() + s > MAX_SIZE) {
- currentXCoordinate = -1;
- currentYCoordinate = -1;
+ if (_baos.size() + s > MAX_SIZE) {
+ _currentXCoordinate = -1;
+ _currentYCoordinate = -1;
throw new MaximumSizeExceededException();
}
byte[] outputdata = afpdata.toByteArray();
- baos.write(outputdata, 0, outputdata.length);
+ _baos.write(outputdata, 0, outputdata.length);
}
@@ -444,7 +443,7 @@
private void setTextOrientation(int orientation,
ByteArrayOutputStream afpdata) {
- afpdata.write(new byte[] {0x06, (byte) 0xF7}, 0, 2);
+ afpdata.write(new byte[] { 0x06, (byte) 0xF7, }, 0, 2);
switch (orientation) {
case 90:
@@ -560,11 +559,12 @@
* Accessor method to write the AFP datastream for
* the text data.
* @param os The stream to write to
- * @throws java.io.IOException if an I/O exception occurred
+ * @throws java.io.IOException
*/
- public void writeDataStream(OutputStream os) throws IOException {
+ public void writeDataStream(OutputStream os)
+ throws IOException {
- byte[] data = baos.toByteArray();
+ byte[] data = _baos.toByteArray();
byte[] size = BinaryUtils.convert(data.length - 1, 2);
data[1] = size[0];
data[2] = size[1];
@@ -580,7 +580,7 @@
* presentation text data objects, but must eventually be terminated. This
* method terminates the control sequence.
*
- * @throws MaximumSizeExceededException if the maximum size is exceeded
+ * @throws MaximumSizeExceededException
*/
public void endControlSequence() throws MaximumSizeExceededException {
@@ -588,10 +588,12 @@
data[0] = 0x02;
data[1] = (byte) 0xF8;
- if (data.length + baos.size() > MAX_SIZE) {
+ if (data.length + _baos.size() > MAX_SIZE) {
throw new MaximumSizeExceededException();
}
- baos.write(data, 0, data.length);
+
+ _baos.write(data, 0, data.length);
+
}
}
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextDescriptor.java Thu Mar 6 05:33:44 2008
@@ -52,11 +52,12 @@
* width and height.
* @param width The width of the page.
* @param height The height of the page.
- * @param widthRes The width resolution of the page.
- * @param heightRes The height resolution of the page.
+ * @param widthResolution The width resolution of the page.
+ * @param heightResolution The height resolution of the page.
*/
- public PresentationTextDescriptor(int width, int height, int widthRes, int heightRes) {
- super(width, height, widthRes, heightRes);
+ public PresentationTextDescriptor(int width, int height,
+ int widthResolution, int heightResolution) {
+ super(width, height, widthResolution, heightResolution);
}
/**
@@ -80,11 +81,11 @@
data[9] = 0x00;
data[10] = 0x00;
- byte[] xdpi = BinaryUtils.convert(widthRes * 10, 2);
+ byte[] xdpi = BinaryUtils.convert(widthResolution * 10, 2);
data[11] = xdpi[0]; // xdpi
data[12] = xdpi[1];
- byte[] ydpi = BinaryUtils.convert(heightRes * 10, 2);
+ byte[] ydpi = BinaryUtils.convert(heightResolution * 10, 2);
data[13] = ydpi[0]; // ydpi
data[14] = ydpi[1];
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java Thu Mar 6 05:33:44 2008
@@ -100,7 +100,7 @@
/**
* Create the presentation text data for the byte array of data.
*
- * @param fontReference
+ * @param fontNumber
* The font resource identifier.
* @param x
* The x coordinate for the text data.
@@ -117,7 +117,7 @@
* @param data
* The text data to be created.
*/
- public void createTextData(int fontReference, int x, int y, int orientation,
+ public void createTextData(int fontNumber, int x, int y, int orientation,
Color col, int vsci, int ica, byte[] data) {
if (currentPresentationTextData == null) {
@@ -126,13 +126,13 @@
try {
- currentPresentationTextData.createTextData(fontReference, x, y,
+ currentPresentationTextData.createTextData(fontNumber, x, y,
orientation, col, vsci, ica, data);
} catch (MaximumSizeExceededException msee) {
endPresentationTextData();
- createTextData(fontReference, x, y, orientation, col, vsci, ica, data);
+ createTextData(fontNumber, x, y, orientation, col, vsci, ica, data);
}
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/TagLogicalElementBean.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/TagLogicalElementBean.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/TagLogicalElementBean.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/afp/modca/TagLogicalElementBean.java Thu Mar 6 05:33:44 2008
@@ -47,7 +47,7 @@
* @return the key
*/
public String getKey() {
- return this.key;
+ return key;
}
/**
@@ -55,7 +55,7 @@
* @return the value
*/
public String getValue() {
- return this.value;
+ return value;
}
}
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/AWTRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/AWTRendererMaker.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/AWTRendererMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/AWTRendererMaker.java Thu Mar 6 05:33:44 2008
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.render.awt;
-
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.render.AbstractRendererMaker;
-import org.apache.fop.render.Renderer;
-
-/**
- * RendererMaker for the AWT Preview Renderer.
- */
-public class AWTRendererMaker extends AbstractRendererMaker {
-
- private static final String[] MIMES = new String[] {MimeConstants.MIME_FOP_AWT_PREVIEW};
-
-
- /** {@inheritDoc} */
- public Renderer makeRenderer(FOUserAgent ua) {
- return new AWTRenderer();
- }
-
- /** {@inheritDoc} */
- public boolean needsOutputStream() {
- return false;
- }
-
- /** {@inheritDoc} */
- public String[] getSupportedMimeTypes() {
- return MIMES;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.awt;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.MimeConstants;
+import org.apache.fop.render.AbstractRendererMaker;
+import org.apache.fop.render.Renderer;
+
+/**
+ * RendererMaker for the AWT Preview Renderer.
+ */
+public class AWTRendererMaker extends AbstractRendererMaker {
+
+ private static final String[] MIMES = new String[] {MimeConstants.MIME_FOP_AWT_PREVIEW};
+
+
+ /** {@inheritDoc} */
+ public Renderer makeRenderer(FOUserAgent ua) {
+ return new AWTRenderer();
+ }
+
+ /** {@inheritDoc} */
+ public boolean needsOutputStream() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public String[] getSupportedMimeTypes() {
+ return MIMES;
+ }
+
+}
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/AWTRendererMaker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/viewer/Command.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/viewer/GoToPageDialog.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/viewer/StatusListener.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/awt/viewer/Translator.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java Thu Mar 6 05:33:44 2008
@@ -1,75 +1,75 @@
-package org.apache.fop.render.bitmap;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * This utility class helps renderers who generate one file per page,
- * like the PNG renderer.
- */
-public class MultiFileRenderingUtil {
-
- /** The file syntax prefix, eg. "page" will output "page1.png" etc */
- private String filePrefix;
-
- private String fileExtension;
-
- /** The output directory where images are to be written */
- private File outputDir;
-
- /**
- * Creates a new instance.
- * <p>
- * The file name must not have an extension, or must have extension "png",
- * and its last period must not be at the start (empty file prefix).
- * @param ext the extension to be used
- * @param outputFile the output file or null if there's no such information
- */
- public MultiFileRenderingUtil(String ext, File outputFile) {
- this.fileExtension = ext;
- // the file provided on the command line
- if (outputFile == null) {
- //No filename information available. Only the first page will be rendered.
- outputDir = null;
- filePrefix = null;
- } else {
- outputDir = outputFile.getParentFile();
-
- // extracting file name syntax
- String s = outputFile.getName();
- int i = s.lastIndexOf(".");
- if (i > 0) {
- // Make sure that the file extension was "png"
- String extension = s.substring(i + 1).toLowerCase();
- if (!ext.equals(extension)) {
- throw new IllegalArgumentException("Invalid file extension ('"
- + extension + "') specified");
- }
- } else if (i == -1) {
- i = s.length();
- } else { // i == 0
- throw new IllegalArgumentException("Invalid file name ('"
- + s + "') specified");
- }
- if (s.charAt(i - 1) == '1') {
- i--; // getting rid of the "1"
- }
- filePrefix = s.substring(0, i);
- }
- }
-
- public OutputStream createOutputStream(int pageNumber) throws IOException {
- if (filePrefix == null) {
- return null;
- } else {
- File f = new File(outputDir,
- filePrefix + (pageNumber + 1) + "." + fileExtension);
- OutputStream os = new BufferedOutputStream(new FileOutputStream(f));
- return os;
- }
- }
-
-}
+package org.apache.fop.render.bitmap;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * This utility class helps renderers who generate one file per page,
+ * like the PNG renderer.
+ */
+public class MultiFileRenderingUtil {
+
+ /** The file syntax prefix, eg. "page" will output "page1.png" etc */
+ private String filePrefix;
+
+ private String fileExtension;
+
+ /** The output directory where images are to be written */
+ private File outputDir;
+
+ /**
+ * Creates a new instance.
+ * <p>
+ * The file name must not have an extension, or must have extension "png",
+ * and its last period must not be at the start (empty file prefix).
+ * @param ext the extension to be used
+ * @param outputFile the output file or null if there's no such information
+ */
+ public MultiFileRenderingUtil(String ext, File outputFile) {
+ this.fileExtension = ext;
+ // the file provided on the command line
+ if (outputFile == null) {
+ //No filename information available. Only the first page will be rendered.
+ outputDir = null;
+ filePrefix = null;
+ } else {
+ outputDir = outputFile.getParentFile();
+
+ // extracting file name syntax
+ String s = outputFile.getName();
+ int i = s.lastIndexOf(".");
+ if (i > 0) {
+ // Make sure that the file extension was "png"
+ String extension = s.substring(i + 1).toLowerCase();
+ if (!ext.equals(extension)) {
+ throw new IllegalArgumentException("Invalid file extension ('"
+ + extension + "') specified");
+ }
+ } else if (i == -1) {
+ i = s.length();
+ } else { // i == 0
+ throw new IllegalArgumentException("Invalid file name ('"
+ + s + "') specified");
+ }
+ if (s.charAt(i - 1) == '1') {
+ i--; // getting rid of the "1"
+ }
+ filePrefix = s.substring(0, i);
+ }
+ }
+
+ public OutputStream createOutputStream(int pageNumber) throws IOException {
+ if (filePrefix == null) {
+ return null;
+ } else {
+ File f = new File(outputDir,
+ filePrefix + (pageNumber + 1) + "." + fileExtension);
+ OutputStream os = new BufferedOutputStream(new FileOutputStream(f));
+ return os;
+ }
+ }
+
+}
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/PNGRenderer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java Thu Mar 6 05:33:44 2008
@@ -1,57 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.render.bitmap;
-
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.render.AbstractRendererMaker;
-import org.apache.fop.render.Renderer;
-import org.apache.fop.render.RendererConfigurator;
-import org.apache.fop.render.java2d.Java2DRendererConfigurator;
-
-/**
- * RendererMaker for the PNG Renderer.
- */
-public class PNGRendererMaker extends AbstractRendererMaker {
-
- private static final String[] MIMES = new String[] {MimeConstants.MIME_PNG};
-
-
- /** {@inheritDoc} */
- public Renderer makeRenderer(FOUserAgent ua) {
- return new PNGRenderer();
- }
-
- /** {@inheritDoc} */
- public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
- return new Java2DRendererConfigurator(userAgent);
- }
-
- /** {@inheritDoc} */
- public boolean needsOutputStream() {
- return true;
- }
-
- /** {@inheritDoc} */
- public String[] getSupportedMimeTypes() {
- return MIMES;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.bitmap;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.MimeConstants;
+import org.apache.fop.render.AbstractRendererMaker;
+import org.apache.fop.render.Renderer;
+import org.apache.fop.render.RendererConfigurator;
+import org.apache.fop.render.java2d.Java2DRendererConfigurator;
+
+/**
+ * RendererMaker for the PNG Renderer.
+ */
+public class PNGRendererMaker extends AbstractRendererMaker {
+
+ private static final String[] MIMES = new String[] {MimeConstants.MIME_PNG};
+
+
+ /** {@inheritDoc} */
+ public Renderer makeRenderer(FOUserAgent ua) {
+ return new PNGRenderer();
+ }
+
+ /** {@inheritDoc} */
+ public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
+ return new Java2DRendererConfigurator(userAgent);
+ }
+
+ /** {@inheritDoc} */
+ public boolean needsOutputStream() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ public String[] getSupportedMimeTypes() {
+ return MIMES;
+ }
+
+}
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java Thu Mar 6 05:33:44 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.render.bitmap;
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java Thu Mar 6 05:33:44 2008
@@ -1,55 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.render.bitmap;
-
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.render.AbstractRendererMaker;
-import org.apache.fop.render.Renderer;
-import org.apache.fop.render.RendererConfigurator;
-
-/**
- * RendererMaker for the TIFF Renderer.
- */
-public class TIFFRendererMaker extends AbstractRendererMaker {
-
- private static final String[] MIMES = new String[] {MimeConstants.MIME_TIFF};
-
- /** {@inheritDoc} */
- public Renderer makeRenderer(FOUserAgent userAgent) {
- return new TIFFRenderer();
- }
-
- /** {@inheritDoc} */
- public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
- return new TIFFRendererConfigurator(userAgent);
- }
-
- /** {@inheritDoc} */
- public boolean needsOutputStream() {
- return true;
- }
-
- /** {@inheritDoc} */
- public String[] getSupportedMimeTypes() {
- return MIMES;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.bitmap;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.MimeConstants;
+import org.apache.fop.render.AbstractRendererMaker;
+import org.apache.fop.render.Renderer;
+import org.apache.fop.render.RendererConfigurator;
+
+/**
+ * RendererMaker for the TIFF Renderer.
+ */
+public class TIFFRendererMaker extends AbstractRendererMaker {
+
+ private static final String[] MIMES = new String[] {MimeConstants.MIME_TIFF};
+
+ /** {@inheritDoc} */
+ public Renderer makeRenderer(FOUserAgent userAgent) {
+ return new TIFFRenderer();
+ }
+
+ /** {@inheritDoc} */
+ public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
+ return new TIFFRendererConfigurator(userAgent);
+ }
+
+ /** {@inheritDoc} */
+ public boolean needsOutputStream() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ public String[] getSupportedMimeTypes() {
+ return MIMES;
+ }
+
+}
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/FontSetup.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java Thu Mar 6 05:33:44 2008
@@ -1,82 +1,82 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.render.java2d;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.io.IOException;
-
-import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
-
-import org.apache.fop.render.Graphics2DAdapter;
-import org.apache.fop.render.RendererContext;
-
-/**
- * Graphics2DAdapter implementation for Java2D.
- */
-public class Java2DGraphics2DAdapter implements Graphics2DAdapter {
-
- /** {@inheritDoc} */
- public void paintImage(Graphics2DImagePainter painter,
- RendererContext context,
- int x, int y, int width, int height) throws IOException {
-
- 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;
- float imh = (float)dim.getHeight() / 1000f;
-
- float sx = fwidth / (float)imw;
- float sy = fheight / (float)imh;
-
- Java2DRenderer renderer = (Java2DRenderer)context.getRenderer();
- Java2DGraphicsState state = renderer.state;
-
- //Create copy and paint on that
- Graphics2D g2d = (Graphics2D)state.getGraph().create();
- g2d.setColor(Color.black);
- g2d.setBackground(Color.black);
-
- //TODO Clip to the image area.
-
- // transform so that the coordinates (0,0) is from the top left
- // and positive is down and to the right. (0,0) is where the
- // viewBox puts it.
- g2d.translate(fx, fy);
- AffineTransform at = AffineTransform.getScaleInstance(sx, sy);
- if (!at.isIdentity()) {
- g2d.transform(at);
- }
-
- Rectangle2D area = new Rectangle2D.Double(0.0, 0.0, imw, imh);
- painter.paint(g2d, area);
-
- g2d.dispose();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.java2d;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+
+import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
+
+import org.apache.fop.render.Graphics2DAdapter;
+import org.apache.fop.render.RendererContext;
+
+/**
+ * Graphics2DAdapter implementation for Java2D.
+ */
+public class Java2DGraphics2DAdapter implements Graphics2DAdapter {
+
+ /** {@inheritDoc} */
+ public void paintImage(Graphics2DImagePainter painter,
+ RendererContext context,
+ int x, int y, int width, int height) throws IOException {
+
+ 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;
+ float imh = (float)dim.getHeight() / 1000f;
+
+ float sx = fwidth / (float)imw;
+ float sy = fheight / (float)imh;
+
+ Java2DRenderer renderer = (Java2DRenderer)context.getRenderer();
+ Java2DGraphicsState state = renderer.state;
+
+ //Create copy and paint on that
+ Graphics2D g2d = (Graphics2D)state.getGraph().create();
+ g2d.setColor(Color.black);
+ g2d.setBackground(Color.black);
+
+ //TODO Clip to the image area.
+
+ // transform so that the coordinates (0,0) is from the top left
+ // and positive is down and to the right. (0,0) is where the
+ // viewBox puts it.
+ g2d.translate(fx, fy);
+ AffineTransform at = AffineTransform.getScaleInstance(sx, sy);
+ if (!at.isIdentity()) {
+ g2d.transform(at);
+ }
+
+ Rectangle2D area = new Rectangle2D.Double(0.0, 0.0, imw, imh);
+ painter.paint(g2d, area);
+
+ g2d.dispose();
+ }
+
+}
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRenderer.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRenderer.java Thu Mar 6 05:33:44 2008
@@ -35,6 +35,7 @@
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
@@ -311,6 +312,8 @@
graphics.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
}
+ graphics.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
+ RenderingHints.VALUE_STROKE_PURE);
// transform page based on scale factor supplied
AffineTransform at = graphics.getTransform();
@@ -929,6 +932,8 @@
} catch (ImageException ie) {
log.error("Error while processing image: "
+ (info != null ? info.toString() : uri), ie);
+ } catch (FileNotFoundException fnfe) {
+ log.error(fnfe.getMessage());
} catch (IOException ioe) {
log.error("I/O error while processing image: "
+ (info != null ? info.toString() : uri), ioe);
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java Thu Mar 6 05:33:44 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.render.java2d;
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Thu Mar 6 05:33:44 2008
@@ -1 +1 @@
-Author Date Id Revision
+Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/DefaultMonochromeBitmapConverter.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/JAIMonochromeBitmapConverter.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/MonochromeBitmapConverter.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLGenerator.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLGraphics2D.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLPageDefinition.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java Thu Mar 6 05:33:44 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.render.pcl;
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererContext.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java Thu Mar 6 05:33:44 2008
@@ -1,57 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.render.pcl;
-
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.render.AbstractRendererMaker;
-import org.apache.fop.render.Renderer;
-import org.apache.fop.render.RendererConfigurator;
-
-/**
- * RendererMaker for the PCL Renderer.
- */
-public class PCLRendererMaker extends AbstractRendererMaker {
-
- private static final String[] MIMES = new String[] {
- MimeConstants.MIME_PCL,
- MimeConstants.MIME_PCL_ALT
- };
-
- /**{@inheritDoc} */
- public Renderer makeRenderer(FOUserAgent userAgent) {
- return new PCLRenderer();
- }
-
- /** {@inheritDoc} */
- public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
- return new PCLRendererConfigurator(userAgent);
- }
-
- /** {@inheritDoc} */
- public boolean needsOutputStream() {
- return true;
- }
-
- /** {@inheritDoc} */
- public String[] getSupportedMimeTypes() {
- return MIMES;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.pcl;
+
+import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.MimeConstants;
+import org.apache.fop.render.AbstractRendererMaker;
+import org.apache.fop.render.Renderer;
+import org.apache.fop.render.RendererConfigurator;
+
+/**
+ * RendererMaker for the PCL Renderer.
+ */
+public class PCLRendererMaker extends AbstractRendererMaker {
+
+ private static final String[] MIMES = new String[] {
+ MimeConstants.MIME_PCL,
+ MimeConstants.MIME_PCL_ALT
+ };
+
+ /**{@inheritDoc} */
+ public Renderer makeRenderer(FOUserAgent userAgent) {
+ return new PCLRenderer();
+ }
+
+ /** {@inheritDoc} */
+ public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
+ return new PCLRendererConfigurator(userAgent);
+ }
+
+ /** {@inheritDoc} */
+ public boolean needsOutputStream() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ public String[] getSupportedMimeTypes() {
+ return MIMES;
+ }
+}
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/PCLSVGHandler.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/extensions/PCLElementMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/extensions/PCLElementMapping.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/extensions/PCLElementMapping.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/extensions/PCLElementMapping.java Thu Mar 6 05:33:44 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: AFPElementMapping.java 397875 2006-04-28 11:58:33Z manuel $ */
+/* $Id$ */
package org.apache.fop.render.pcl.extensions;
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pcl/extensions/PCLElementMapping.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java Thu Mar 6 05:33:44 2008
@@ -59,6 +59,9 @@
public AbstractImageAdapter(Image image, String key) {
this.image = image;
this.key = key;
+ if (log.isDebugEnabled()) {
+ log.debug("New ImageAdapter created for key: " + key);
+ }
}
/** {@inheritDoc} */
@@ -81,27 +84,7 @@
ICC_Profile prof = image.getICCProfile();
PDFDeviceColorSpace pdfCS = toPDFColorSpace(getImageColorSpace());
if (prof != null) {
- boolean defaultsRGB = ColorProfileUtil.isDefaultsRGB(prof);
- String desc = ColorProfileUtil.getICCProfileDescription(prof);
- if (log.isDebugEnabled()) {
- log.debug("Image returns ICC profile: " + desc + ", default sRGB=" + defaultsRGB);
- }
- PDFICCBasedColorSpace cs = doc.getResources().getICCColorSpaceByProfileName(desc);
- if (!defaultsRGB) {
- if (cs == null) {
- pdfICCStream = doc.getFactory().makePDFICCStream();
- pdfICCStream.setColorSpace(prof, pdfCS);
- cs = doc.getFactory().makeICCBasedColorSpace(null, null, pdfICCStream);
- } else {
- pdfICCStream = cs.getICCStream();
- }
- } else {
- if (cs == null && "sRGB".equals(desc)) {
- //It's the default sRGB profile which we mapped to DefaultRGB in PDFRenderer
- cs = doc.getResources().getColorSpace("DefaultRGB");
- }
- pdfICCStream = cs.getICCStream();
- }
+ pdfICCStream = setupColorProfile(doc, prof, pdfCS);
}
if (doc.getProfile().getPDFAMode().isPDFA1LevelB()) {
if (pdfCS != null
@@ -111,10 +94,42 @@
//See PDF/A-1, ISO 19005:1:2005(E), 6.2.3.3
//FOP is currently restricted to DeviceRGB if PDF/A-1 is active.
throw new PDFConformanceException(
- "PDF/A-1 does not allow mixing DeviceRGB and DeviceCMYK: "
- + image.getInfo());
+ "PDF/A-1 does not allow mixing DeviceRGB and DeviceCMYK: "
+ + image.getInfo());
+ }
+ }
+ }
+
+ private static PDFICCStream setupColorProfile(PDFDocument doc,
+ ICC_Profile prof, PDFDeviceColorSpace pdfCS) {
+ boolean defaultsRGB = ColorProfileUtil.isDefaultsRGB(prof);
+ String desc = ColorProfileUtil.getICCProfileDescription(prof);
+ if (log.isDebugEnabled()) {
+ log.debug("Image returns ICC profile: " + desc + ", default sRGB=" + defaultsRGB);
+ }
+ PDFICCBasedColorSpace cs = doc.getResources().getICCColorSpaceByProfileName(desc);
+ PDFICCStream pdfICCStream;
+ if (!defaultsRGB) {
+ if (cs == null) {
+ pdfICCStream = doc.getFactory().makePDFICCStream();
+ pdfICCStream.setColorSpace(prof, pdfCS);
+ cs = doc.getFactory().makeICCBasedColorSpace(null, null, pdfICCStream);
+ } else {
+ pdfICCStream = cs.getICCStream();
+ }
+ } else {
+ if (cs == null && desc.startsWith("sRGB")) {
+ //It's the default sRGB profile which we mapped to DefaultRGB in PDFRenderer
+ cs = doc.getResources().getColorSpace("DefaultRGB");
+ if (cs == null) {
+ //sRGB hasn't been set up for the PDF document
+ //so install but don't set to DefaultRGB
+ cs = PDFICCBasedColorSpace.setupsRGBColorSpace(doc);
+ }
}
+ pdfICCStream = cs.getICCStream();
}
+ return pdfICCStream;
}
/** {@inheritDoc} */
Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java?rev=634267&r1=634266&r2=634267&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java Thu Mar 6 05:33:44 2008
@@ -1,130 +1,130 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.render.pdf;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-
-import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
-
-import org.apache.fop.render.AbstractGraphics2DAdapter;
-import org.apache.fop.render.RendererContext;
-import org.apache.fop.render.RendererContext.RendererContextWrapper;
-import org.apache.fop.svg.PDFGraphics2D;
-
-/**
- * Graphics2DAdapter implementation for PDF.
- */
-public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
-
- private PDFRenderer renderer;
-
- /**
- * Main constructor
- * @param renderer the Renderer instance to which this instance belongs
- */
- 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;
- float imh = (float)dim.getHeight() / 1000f;
-
- float sx = fwidth / (float)imw;
- float sy = fheight / (float)imh;
-
- 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
- // and positive is down and to the right. (0,0) is where the
- // viewBox puts it.
- renderer.currentStream.add(sx + " 0 0 " + sy + " " + fx + " "
- + fy + " cm\n");
-
-
- final boolean textAsShapes = false;
- if (pdfInfo.pdfContext == null) {
- pdfInfo.pdfContext = pdfInfo.pdfPage;
- }
- PDFGraphics2D graphics = new PDFGraphics2D(textAsShapes,
- pdfInfo.fi, pdfInfo.pdfDoc,
- pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
- renderer.currentFontName,
- renderer.currentFontSize);
- graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
-
- AffineTransform transform = new AffineTransform();
- transform.translate(fx, fy);
- pdfInfo.pdfState.concatenate(transform);
- graphics.setPDFState(pdfInfo.pdfState);
- graphics.setOutputStream(pdfInfo.outputStream);
-
- if (pdfInfo.paintAsBitmap) {
- //Fallback solution: Paint to a BufferedImage
- int resolution = (int)Math.round(context.getUserAgent().getTargetResolution());
- RendererContextWrapper ctx = RendererContext.wrapRendererContext(context);
- BufferedImage bi = paintToBufferedImage(painter, ctx, resolution, false, false);
-
- float scale = PDFRenderer.NORMAL_PDF_RESOLUTION
- / context.getUserAgent().getTargetResolution();
- graphics.drawImage(bi, new AffineTransform(scale, 0, 0, scale, 0, 0), null);
- } else {
- Rectangle2D area = new Rectangle2D.Double(0.0, 0.0, imw, imh);
- painter.paint(graphics, area);
- }
-
- pdfInfo.currentStream.add(graphics.getString());
- renderer.restoreGraphicsState();
- pdfInfo.pdfState.pop();
- }
-
- /** {@inheritDoc} */
- protected void setRenderingHintsForBufferedImage(Graphics2D g2d) {
- super.setRenderingHintsForBufferedImage(g2d);
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.pdf;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+
+import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
+
+import org.apache.fop.render.AbstractGraphics2DAdapter;
+import org.apache.fop.render.RendererContext;
+import org.apache.fop.render.RendererContext.RendererContextWrapper;
+import org.apache.fop.svg.PDFGraphics2D;
+
+/**
+ * Graphics2DAdapter implementation for PDF.
+ */
+public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
+
+ private PDFRenderer renderer;
+
+ /**
+ * Main constructor
+ * @param renderer the Renderer instance to which this instance belongs
+ */
+ 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;
+ float imh = (float)dim.getHeight() / 1000f;
+
+ float sx = fwidth / (float)imw;
+ float sy = fheight / (float)imh;
+
+ 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
+ // and positive is down and to the right. (0,0) is where the
+ // viewBox puts it.
+ renderer.currentStream.add(sx + " 0 0 " + sy + " " + fx + " "
+ + fy + " cm\n");
+
+
+ final boolean textAsShapes = false;
+ if (pdfInfo.pdfContext == null) {
+ pdfInfo.pdfContext = pdfInfo.pdfPage;
+ }
+ PDFGraphics2D graphics = new PDFGraphics2D(textAsShapes,
+ pdfInfo.fi, pdfInfo.pdfDoc,
+ pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
+ renderer.currentFontName,
+ renderer.currentFontSize);
+ graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
+
+ AffineTransform transform = new AffineTransform();
+ transform.translate(fx, fy);
+ pdfInfo.pdfState.concatenate(transform);
+ graphics.setPDFState(pdfInfo.pdfState);
+ graphics.setOutputStream(pdfInfo.outputStream);
+
+ if (pdfInfo.paintAsBitmap) {
+ //Fallback solution: Paint to a BufferedImage
+ int resolution = (int)Math.round(context.getUserAgent().getTargetResolution());
+ RendererContextWrapper ctx = RendererContext.wrapRendererContext(context);
+ BufferedImage bi = paintToBufferedImage(painter, ctx, resolution, false, false);
+
+ float scale = PDFRenderer.NORMAL_PDF_RESOLUTION
+ / context.getUserAgent().getTargetResolution();
+ graphics.drawImage(bi, new AffineTransform(scale, 0, 0, scale, 0, 0), null);
+ } else {
+ Rectangle2D area = new Rectangle2D.Double(0.0, 0.0, imw, imh);
+ painter.paint(graphics, area);
+ }
+
+ pdfInfo.currentStream.add(graphics.getString());
+ renderer.restoreGraphicsState();
+ pdfInfo.pdfState.pop();
+ }
+
+ /** {@inheritDoc} */
+ protected void setRenderingHintsForBufferedImage(Graphics2D g2d) {
+ super.setRenderingHintsForBufferedImage(g2d);
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+ RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+ }
+
+}
Propchange: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org