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/25 12:56:32 UTC
svn commit: r679758 [25/34] - in
/xmlgraphics/fop/branches/Temp_AFPGOCAResources: ./
examples/embedding/java/embedding/ examples/embedding/java/embedding/events/
examples/embedding/java/embedding/intermediate/
examples/embedding/java/embedding/model/ e...
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLPageDefinition.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLPageDefinition.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLPageDefinition.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLPageDefinition.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererContext.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererContext.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererContext.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRendererMaker.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLSVGHandler.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLSVGHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLSVGHandler.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/CTMHelper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/CTMHelper.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/CTMHelper.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/CTMHelper.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFEventProducer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFEventProducer.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFEventProducer.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFEventProducer.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandler.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandler.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java Fri Jul 25 03:55:49 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/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java Fri Jul 25 03:55:49 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();
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRenderer.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRenderer.java Fri Jul 25 03:55:49 2008
@@ -122,7 +122,7 @@
* Renderer that renders areas to PDF.
*/
public class PDFRenderer extends AbstractPathOrientedRenderer {
-
+
/**
* The mime type for pdf
*/
@@ -130,7 +130,7 @@
/** Normal PDF resolution (72dpi) */
public static final int NORMAL_PDF_RESOLUTION = 72;
-
+
/** PDF encryption parameter: all parameters as object, datatype: PDFEncryptionParams */
public static final String ENCRYPTION_PARAMS = "encryption-params";
/** PDF encryption parameter: user password, datatype: String */
@@ -159,7 +159,7 @@
/** Controls whether comments are written to the PDF stream. */
protected static final boolean WRITE_COMMENTS = true;
-
+
/**
* the PDF Document being created
*/
@@ -167,10 +167,10 @@
/** the PDF/A mode (Default: disabled) */
protected PDFAMode pdfAMode = PDFAMode.DISABLED;
-
+
/** the PDF/X mode (Default: disabled) */
protected PDFXMode pdfXMode = PDFXMode.DISABLED;
-
+
/**
* Map of pages using the PageViewport as the key
* this is used for prepared pages that cannot be immediately
@@ -246,10 +246,10 @@
protected PDFICCBasedColorSpace sRGBColorSpace;
/** controls whether the sRGB color space should be installed */
protected boolean disableSRGBColorSpace = false;
-
+
/** Optional URI to an output profile to be used. */
- protected String outputProfileURI;
-
+ protected String outputProfileURI;
+
/** drawing state */
protected PDFState currentState = null;
@@ -263,7 +263,7 @@
/** Image handler registry */
private PDFImageHandlerRegistry imageHandlerRegistry = new PDFImageHandlerRegistry();
-
+
/**
* create the PDF renderer
*/
@@ -279,13 +279,13 @@
throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected.");
}
}
-
+
/**
* {@inheritDoc}
*/
public void setUserAgent(FOUserAgent agent) {
super.setUserAgent(agent);
- PDFEncryptionParams params
+ PDFEncryptionParams params
= (PDFEncryptionParams)agent.getRendererOptions().get(ENCRYPTION_PARAMS);
if (params != null) {
this.encryptionParams = params; //overwrite if available
@@ -381,7 +381,7 @@
}
if (pdfXMode != PDFXMode.DISABLED) {
log.debug(pdfXMode + " is active.");
- log.warn("Note: " + pdfXMode
+ log.warn("Note: " + pdfXMode
+ " support is work-in-progress and not fully implemented, yet!");
addPDFXOutputIntent();
}
@@ -389,7 +389,7 @@
log.debug("PDF/A is active. Conformance Level: " + pdfAMode);
addPDFA1OutputIntent();
}
-
+
}
private void addsRGBColorSpace() throws IOException {
@@ -409,7 +409,7 @@
this.sRGBColorSpace = PDFICCBasedColorSpace.setupsRGBAsDefaultRGBColorSpace(pdfDoc);
}
}
-
+
private void addDefaultOutputProfile() throws IOException {
if (this.outputProfile != null) {
return;
@@ -438,7 +438,7 @@
outputProfile = sRGBColorSpace.getICCStream();
}
}
-
+
/**
* Adds an OutputIntent to the PDF as mandated by PDF/A-1 when uncalibrated color spaces
* are used (which is true if we use DeviceRGB to represent sRGB colors).
@@ -446,7 +446,7 @@
*/
private void addPDFA1OutputIntent() throws IOException {
addDefaultOutputProfile();
-
+
String desc = ColorProfileUtil.getICCProfileDescription(this.outputProfile.getICCProfile());
PDFOutputIntent outputIntent = pdfDoc.getFactory().makeOutputIntent();
outputIntent.setSubtype(PDFOutputIntent.GTS_PDFA1);
@@ -463,7 +463,7 @@
*/
private void addPDFXOutputIntent() throws IOException {
addDefaultOutputProfile();
-
+
String desc = ColorProfileUtil.getICCProfileDescription(this.outputProfile.getICCProfile());
int deviceClass = this.outputProfile.getICCProfile().getProfileClass();
if (deviceClass != ICC_Profile.CLASS_OUTPUT) {
@@ -627,7 +627,7 @@
return new PDFGraphics2DAdapter(this);
}
- /**
+ /**
* writes out a comment.
* @param text text for the comment
*/
@@ -738,7 +738,7 @@
page.getPageIndex());
pageReferences.put(page.getKey(), currentPage.referencePDF());
pvReferences.put(page.getKey(), page);
-
+
//Produce page labels
PDFPageLabels pageLabels = this.pdfDoc.getRoot().getPageLabels();
if (pageLabels == null) {
@@ -746,14 +746,14 @@
pageLabels = this.pdfDoc.getFactory().makePageLabels();
this.pdfDoc.getRoot().setPageLabels(pageLabels);
}
- PDFNumsArray nums = pageLabels.getNums();
+ PDFNumsArray nums = pageLabels.getNums();
PDFDictionary dict = new PDFDictionary(nums);
dict.put("P", page.getPageNumberString());
//TODO If the sequence of generated page numbers were inspected, this could be
//expressed in a more space-efficient way
nums.put(page.getPageIndex(), dict);
}
-
+
/**
* This method creates a pdf stream for the current page
* uses it as the contents of a new page. The page is written
@@ -789,7 +789,7 @@
pageHeight / 1000f);
currentState.concatenate(basicPageTransform);
currentStream.add(CTMHelper.toPDFString(basicPageTransform, false) + " cm\n");
-
+
super.renderPage(page);
this.pdfDoc.registerObject(currentStream);
@@ -811,9 +811,9 @@
new AffineTransform(CTMHelper.toPDFArray(ctm)));
if (clippingRect != null) {
- clipRect((float)clippingRect.getX() / 1000f,
- (float)clippingRect.getY() / 1000f,
- (float)clippingRect.getWidth() / 1000f,
+ clipRect((float)clippingRect.getX() / 1000f,
+ (float)clippingRect.getY() / 1000f,
+ (float)clippingRect.getWidth() / 1000f,
(float)clippingRect.getHeight() / 1000f);
}
// multiply with current CTM
@@ -832,7 +832,7 @@
currentStream.add(CTMHelper.toPDFString(at, false) + " cm\n");
}
}
-
+
/**
* Formats a float value (normally coordinates) as Strings.
* @param value the value
@@ -841,9 +841,9 @@
protected static String format(float value) {
return PDFNumber.doubleOut(value);
}
-
+
/** {@inheritDoc} */
- protected void drawBorderLine(float x1, float y1, float x2, float y2,
+ protected void drawBorderLine(float x1, float y1, float x2, float y2,
boolean horz, boolean startOrBefore, int style, Color col) {
float w = x2 - x1;
float h = y2 - y1;
@@ -853,7 +853,7 @@
return;
}
switch (style) {
- case Constants.EN_DASHED:
+ case Constants.EN_DASHED:
setColor(col, false, null);
if (horz) {
float unit = Math.abs(2 * h);
@@ -865,7 +865,7 @@
currentStream.add("[" + format(unit) + "] 0 d ");
currentStream.add(format(h) + " w\n");
float ym = y1 + (h / 2);
- currentStream.add(format(x1) + " " + format(ym) + " m "
+ currentStream.add(format(x1) + " " + format(ym) + " m "
+ format(x2) + " " + format(ym) + " l S\n");
} else {
float unit = Math.abs(2 * w);
@@ -877,7 +877,7 @@
currentStream.add("[" + format(unit) + "] 0 d ");
currentStream.add(format(w) + " w\n");
float xm = x1 + (w / 2);
- currentStream.add(format(xm) + " " + format(y1) + " m "
+ currentStream.add(format(xm) + " " + format(y1) + " m "
+ format(xm) + " " + format(y2) + " l S\n");
}
break;
@@ -894,7 +894,7 @@
currentStream.add("[0 " + format(unit) + "] 0 d ");
currentStream.add(format(h) + " w\n");
float ym = y1 + (h / 2);
- currentStream.add(format(x1) + " " + format(ym) + " m "
+ currentStream.add(format(x1) + " " + format(ym) + " m "
+ format(x2) + " " + format(ym) + " l S\n");
} else {
float unit = Math.abs(2 * w);
@@ -906,7 +906,7 @@
currentStream.add("[0 " + format(unit) + " ] 0 d ");
currentStream.add(format(w) + " w\n");
float xm = x1 + (w / 2);
- currentStream.add(format(xm) + " " + format(y1) + " m "
+ currentStream.add(format(xm) + " " + format(y1) + " m "
+ format(xm) + " " + format(y2) + " l S\n");
}
break;
@@ -918,18 +918,18 @@
currentStream.add(format(h3) + " w\n");
float ym1 = y1 + (h3 / 2);
float ym2 = ym1 + h3 + h3;
- currentStream.add(format(x1) + " " + format(ym1) + " m "
+ currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
- currentStream.add(format(x1) + " " + format(ym2) + " m "
+ currentStream.add(format(x1) + " " + format(ym2) + " m "
+ format(x2) + " " + format(ym2) + " l S\n");
} else {
float w3 = w / 3;
currentStream.add(format(w3) + " w\n");
float xm1 = x1 + (w3 / 2);
float xm2 = xm1 + w3 + w3;
- currentStream.add(format(xm1) + " " + format(y1) + " m "
+ currentStream.add(format(xm1) + " " + format(y1) + " m "
+ format(xm1) + " " + format(y2) + " l S\n");
- currentStream.add(format(xm2) + " " + format(y1) + " m "
+ currentStream.add(format(xm2) + " " + format(y1) + " m "
+ format(xm2) + " " + format(y2) + " l S\n");
}
break;
@@ -945,13 +945,13 @@
currentStream.add(format(h3) + " w\n");
float ym1 = y1 + (h3 / 2);
setColor(uppercol, false, null);
- currentStream.add(format(x1) + " " + format(ym1) + " m "
+ currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
setColor(col, false, null);
- currentStream.add(format(x1) + " " + format(ym1 + h3) + " m "
+ currentStream.add(format(x1) + " " + format(ym1 + h3) + " m "
+ format(x2) + " " + format(ym1 + h3) + " l S\n");
setColor(lowercol, false, null);
- currentStream.add(format(x1) + " " + format(ym1 + h3 + h3) + " m "
+ currentStream.add(format(x1) + " " + format(ym1 + h3 + h3) + " m "
+ format(x2) + " " + format(ym1 + h3 + h3) + " l S\n");
} else {
Color leftcol = lightenColor(col, -colFactor);
@@ -960,13 +960,13 @@
currentStream.add(format(w3) + " w\n");
float xm1 = x1 + (w3 / 2);
setColor(leftcol, false, null);
- currentStream.add(format(xm1) + " " + format(y1) + " m "
+ currentStream.add(format(xm1) + " " + format(y1) + " m "
+ format(xm1) + " " + format(y2) + " l S\n");
setColor(col, false, null);
- currentStream.add(format(xm1 + w3) + " " + format(y1) + " m "
+ currentStream.add(format(xm1 + w3) + " " + format(y1) + " m "
+ format(xm1 + w3) + " " + format(y2) + " l S\n");
setColor(rightcol, false, null);
- currentStream.add(format(xm1 + w3 + w3) + " " + format(y1) + " m "
+ currentStream.add(format(xm1 + w3 + w3) + " " + format(y1) + " m "
+ format(xm1 + w3 + w3) + " " + format(y2) + " l S\n");
}
break;
@@ -982,14 +982,14 @@
currentStream.add(format(h) + " w\n");
float ym1 = y1 + (h / 2);
setColor(c, false, null);
- currentStream.add(format(x1) + " " + format(ym1) + " m "
+ currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
} else {
c = lightenColor(c, (startOrBefore ? 1 : -1) * colFactor);
currentStream.add(format(w) + " w\n");
float xm1 = x1 + (w / 2);
setColor(c, false, null);
- currentStream.add(format(xm1) + " " + format(y1) + " m "
+ currentStream.add(format(xm1) + " " + format(y1) + " m "
+ format(xm1) + " " + format(y2) + " l S\n");
}
break;
@@ -1002,17 +1002,17 @@
if (horz) {
currentStream.add(format(h) + " w\n");
float ym = y1 + (h / 2);
- currentStream.add(format(x1) + " " + format(ym) + " m "
+ currentStream.add(format(x1) + " " + format(ym) + " m "
+ format(x2) + " " + format(ym) + " l S\n");
} else {
currentStream.add(format(w) + " w\n");
float xm = x1 + (w / 2);
- currentStream.add(format(xm) + " " + format(y1) + " m "
+ currentStream.add(format(xm) + " " + format(y1) + " m "
+ format(xm) + " " + format(y2) + " l S\n");
}
}
}
-
+
/**
* Sets the current line width in points.
* @param width line width in points
@@ -1023,10 +1023,10 @@
currentStream.add(format(width) + " w\n");
}
}
-
+
/** {@inheritDoc} */
protected void clipRect(float x, float y, float width, float height) {
- currentStream.add(format(x) + " " + format(y) + " "
+ currentStream.add(format(x) + " " + format(y) + " "
+ format(width) + " " + format(height) + " re ");
clip();
}
@@ -1040,42 +1040,42 @@
}
/**
- * Moves the current point to (x, y), omitting any connecting line segment.
+ * Moves the current point to (x, y), omitting any connecting line segment.
* @param x x coordinate
* @param y y coordinate
*/
protected void moveTo(float x, float y) {
currentStream.add(format(x) + " " + format(y) + " m ");
}
-
+
/**
- * Appends a straight line segment from the current point to (x, y). The
- * new current point is (x, y).
+ * Appends a straight line segment from the current point to (x, y). The
+ * new current point is (x, y).
* @param x x coordinate
* @param y y coordinate
*/
protected void lineTo(float x, float y) {
currentStream.add(format(x) + " " + format(y) + " l ");
}
-
+
/**
- * Closes the current subpath by appending a straight line segment from
+ * Closes the current subpath by appending a straight line segment from
* the current point to the starting point of the subpath.
*/
protected void closePath() {
currentStream.add("h ");
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
*/
protected void fillRect(float x, float y, float width, float height) {
if (width > 0 && height > 0) {
- currentStream.add(format(x) + " " + format(y) + " "
+ currentStream.add(format(x) + " " + format(y) + " "
+ format(width) + " " + format(height) + " re f\n");
}
}
-
+
/**
* Draw a line.
*
@@ -1131,7 +1131,7 @@
}
/**
- * Returns area's id if it is the first area in the document with that id
+ * Returns area's id if it is the first area in the document with that id
* (i.e. if the area qualifies as a link target).
* Otherwise, or if the area has no id, null is returned.
*
@@ -1216,7 +1216,7 @@
* @param pdfPageRef the PDF page reference string
* @param relativeIPP the *relative* IP position in millipoints
* @param relativeBPP the *relative* BP position in millipoints
- * @param tf the transformation to apply once the relative positions have been
+ * @param tf the transformation to apply once the relative positions have been
* converted to points
*/
protected void saveAbsolutePosition(String id, String pdfPageRef,
@@ -1258,13 +1258,13 @@
* @param relativeBPP the *relative* BP position in millipoints
*/
protected void saveAbsolutePosition(String id, int relativeIPP, int relativeBPP) {
- saveAbsolutePosition(id, currentPageRef,
+ saveAbsolutePosition(id, currentPageRef,
relativeIPP, relativeBPP, currentState.getTransform());
}
/**
- * If the given block area is a possible link target, its id + absolute position will
- * be saved. The saved position is only correct if this function is called at the very
+ * If the given block area is a possible link target, its id + absolute position will
+ * be saved. The saved position is only correct if this function is called at the very
* start of renderBlock!
*
* @param block the block area in question
@@ -1392,7 +1392,7 @@
// warn if link trait found but not allowed, else create link
if (linkTraitFound) {
if (!annotsAllowed) {
- log.warn("Skipping annotation for a link due to PDF profile: "
+ log.warn("Skipping annotation for a link due to PDF profile: "
+ pdfDoc.getProfile());
} else if (action != null) {
PDFLink pdfLink = factory.makeLink(ipRect, action);
@@ -1408,23 +1408,23 @@
}
return tf;
}
-
+
/** {@inheritDoc} */
public void renderText(TextArea text) {
renderInlineAreaBackAndBorders(text);
Color ct = (Color) text.getTrait(Trait.COLOR);
updateColor(ct, true);
-
+
beginTextObject();
String fontName = getInternalFontNameForArea(text);
int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
-
+
// This assumes that *all* CIDFonts use a /ToUnicode mapping
Typeface tf = getTypeface(fontName);
-
+
textutil.updateTf(fontName, size / 1000f, tf.isMultiByte());
-
+
// word.getOffset() = only height of text itself
// currentBlockIPPosition: 0 for beginning of line; nonzero
@@ -1437,7 +1437,7 @@
super.renderText(text);
textutil.writeTJ();
-
+
renderTextDecoration(tf, size, text, bl, rx);
}
@@ -1446,7 +1446,7 @@
Font font = getFontFromArea(word.getParentArea());
String s = word.getWord();
- escapeText(s, word.getLetterAdjustArray(),
+ escapeText(s, word.getLetterAdjustArray(),
font, (AbstractTextArea)word.getParentArea());
super.renderWord(word);
@@ -1456,7 +1456,7 @@
public void renderSpace(SpaceArea space) {
Font font = getFontFromArea(space.getParentArea());
String s = space.getSpace();
-
+
AbstractTextArea textArea = (AbstractTextArea)space.getParentArea();
escapeText(s, null, font, textArea);
@@ -1485,7 +1485,7 @@
Font font, AbstractTextArea parentArea) {
escapeText(s, 0, s.length(), letterAdjust, font, parentArea);
}
-
+
/**
* Escapes text according to PDF rules.
* @param s Text to escape
@@ -1507,7 +1507,7 @@
}
int l = s.length();
-
+
for (int i = start; i < end; i++) {
char orgChar = s.charAt(i);
char ch;
@@ -1553,7 +1553,7 @@
/**
* Establishes a new foreground or fill color. In contrast to updateColor
* this method does not check the PDFState for optimization possibilities.
- * @param col the color to apply
+ * @param col the color to apply
* @param fill true to set the fill color, false for the foreground color
* @param pdf StringBuffer to write the PDF code to, if null, the code is
* written to the current stream.
@@ -1567,7 +1567,7 @@
currentStream.add(color.getColorSpaceOut(fill));
}
}
-
+
/**
* Establishes a new foreground or fill color.
* @param col the color to apply (null skips this operation)
@@ -1595,7 +1595,7 @@
protected void updateColor(Color col, boolean fill) {
updateColor(col, fill, null);
}
-
+
/** {@inheritDoc} */
public void renderImage(Image image, Rectangle2D pos) {
endTextObject();
@@ -1618,7 +1618,7 @@
protected void putImage(String uri, Rectangle2D pos) {
putImage(uri, pos, null);
}
-
+
/**
* Adds a PDF XObject (a bitmap or form) to the PDF that will later be referenced.
* @param uri URL of the bitmap
@@ -1650,11 +1650,11 @@
try {
ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
info = manager.getImageInfo(uri, sessionContext);
-
+
Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
info, imageHandlerRegistry.getSupportedFlavors(), hints, sessionContext);
-
+
//First check for a dynamically registered handler
PDFImageHandler handler = imageHandlerRegistry.getHandler(img.getClass());
if (handler != null) {
@@ -1712,13 +1712,13 @@
currentStream.add(format(w) + " 0 0 "
+ format(-h) + " "
+ format(currentIPPosition / 1000f + x) + " "
- + format(currentBPPosition / 1000f + h + y)
+ + format(currentBPPosition / 1000f + h + y)
+ " cm\n" + xobj.getName() + " Do\n");
restoreGraphicsState();
}
/** {@inheritDoc} */
- protected RendererContext createRendererContext(int x, int y, int width, int height,
+ protected RendererContext createRendererContext(int x, int y, int width, int height,
Map foreignAttributes) {
RendererContext context = super.createRendererContext(
x, y, width, height, foreignAttributes);
@@ -1749,7 +1749,7 @@
int style = area.getRuleStyle();
float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
float starty = (currentBPPosition + area.getOffset()) / 1000f;
- float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ area.getIPD()) / 1000f;
float ruleThickness = area.getRuleThickness() / 1000f;
Color col = (Color)area.getTrait(Trait.COLOR);
@@ -1758,7 +1758,7 @@
case EN_SOLID:
case EN_DASHED:
case EN_DOUBLE:
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_DOTTED:
@@ -1766,7 +1766,7 @@
//This displaces the dots to the right by half a dot's width
//TODO There's room for improvement here
currentStream.add("1 0 0 1 " + format(ruleThickness / 2) + " 0 cm\n");
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_GROOVE:
@@ -1811,7 +1811,7 @@
public String getMimeType() {
return MIME_TYPE;
}
-
+
/**
* Sets the PDF/A mode for the PDF renderer.
* @param mode the PDF/A mode
@@ -1825,7 +1825,7 @@
* @param mode the PDF/X mode
*/
public void setXMode(PDFXMode mode) {
- this.pdfXMode = mode;
+ this.pdfXMode = mode;
}
/**
@@ -1846,7 +1846,7 @@
/**
* Sets the encryption parameters used by the PDF renderer.
- * @param encryptionParams the encryption parameters
+ * @param encryptionParams the encryption parameters
*/
public void setEncryptionParams(PDFEncryptionParams encryptionParams) {
this.encryptionParams = encryptionParams;
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java Fri Jul 25 03:55:49 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,7 +36,7 @@
import org.apache.fop.util.LogUtil;
/**
- * PDF renderer configurator
+ * PDF renderer configurator
*/
public class PDFRendererConfigurator extends PrintRendererConfigurator {
@@ -70,9 +70,9 @@
} catch (ConfigurationException e) {
LogUtil.handleException(log, e, false);
}
-
+
super.configure(renderer);
-
+
String s = cfg.getChild(PDFRenderer.PDF_A_MODE, true).getValue(null);
if (s != null) {
pdfRenderer.setAMode(PDFAMode.valueOf(s));
@@ -143,7 +143,7 @@
* @return Map the newly built filter map
* @throws ConfigurationException if a filter list is defined twice
*/
- public static Map buildFilterMapFromConfiguration(Configuration cfg)
+ public static Map buildFilterMapFromConfiguration(Configuration cfg)
throws ConfigurationException {
Map filterMap = new java.util.HashMap();
Configuration[] filterLists = cfg.getChildren("filterList");
@@ -156,11 +156,11 @@
String name = filt[j].getValue();
filterList.add(name);
}
-
+
if (type == null) {
type = PDFFilterList.DEFAULT_FILTER;
}
-
+
if (!filterList.isEmpty() && log.isDebugEnabled()) {
StringBuffer debug = new StringBuffer("Adding PDF filter");
if (filterList.size() != 1) {
@@ -175,13 +175,13 @@
}
log.debug(debug.toString());
}
-
+
if (filterMap.get(type) != null) {
- throw new ConfigurationException("A filterList of type '"
+ throw new ConfigurationException("A filterList of type '"
+ type + "' has already been defined");
}
filterMap.put(type, filterList);
}
- return filterMap;
+ return filterMap;
}
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java Fri Jul 25 03:55:49 2008
@@ -49,5 +49,5 @@
/** The current pdf font size. */
String PDF_FONT_SIZE = "fontSize";
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java Fri Jul 25 03:55:49 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.
@@ -31,7 +31,7 @@
public class PDFRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_PDF};
-
+
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new PDFRenderer();
@@ -41,7 +41,7 @@
public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
return new PDFRendererConfigurator(userAgent);
}
-
+
/** {@inheritDoc} */
public boolean needsOutputStream() {
return true;
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java?rev=679758&r1=679757&r2=679758&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java Fri Jul 25 03:55:49 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.
@@ -62,7 +62,7 @@
* It renders SVG to the PDF document using the PDFGraphics2D.
* The properties from the PDF renderer are subject to change.
*/
-public class PDFSVGHandler extends AbstractGenericSVGHandler
+public class PDFSVGHandler extends AbstractGenericSVGHandler
implements PDFRendererContextConstants {
/** logging instance */
@@ -93,7 +93,7 @@
Map foreign = (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES);
QName qName = new QName(ExtensionElementMapping.URI, null, "conversion-mode");
- if (foreign != null
+ if (foreign != null
&& "bitmap".equalsIgnoreCase((String)foreign.get(qName))) {
pdfi.paintAsBitmap = true;
}
@@ -156,12 +156,12 @@
int xOffset = pdfInfo.currentXPosition;
int yOffset = pdfInfo.currentYPosition;
- FOUserAgent userAgent = context.getUserAgent();
+ FOUserAgent userAgent = context.getUserAgent();
final float deviceResolution = userAgent.getTargetResolution();
if (log.isDebugEnabled()) {
log.debug("Generating SVG at " + deviceResolution + "dpi.");
}
-
+
final float uaResolution = userAgent.getSourceResolution();
SVGUserAgent ua = new SVGUserAgent(userAgent, new AffineTransform());
@@ -169,22 +169,22 @@
double s = uaResolution / deviceResolution;
AffineTransform resolutionScaling = new AffineTransform();
resolutionScaling.scale(s, s);
-
+
GVTBuilder builder = new GVTBuilder();
-
+
//Controls whether text painted by Batik is generated using text or path operations
boolean strokeText = false;
Configuration cfg = pdfInfo.cfg;
if (cfg != null) {
strokeText = cfg.getChild("stroke-text", true).getValueAsBoolean(strokeText);
}
-
- BridgeContext ctx = new PDFBridgeContext(ua,
+
+ BridgeContext ctx = new PDFBridgeContext(ua,
(strokeText ? null : pdfInfo.fi),
userAgent.getFactory().getImageManager(),
userAgent.getImageSessionContext(),
new AffineTransform());
-
+
GraphicsNode root;
try {
root = builder.build(ctx, doc);
@@ -211,7 +211,7 @@
AffineTransform imageTransform = new AffineTransform();
imageTransform.concatenate(scaling);
imageTransform.concatenate(resolutionScaling);
-
+
/*
* Clip to the svg area.
* Note: To have the svg overlay (under) a text area then use
@@ -232,27 +232,27 @@
if (pdfInfo.pdfContext == null) {
pdfInfo.pdfContext = pdfInfo.pdfPage;
}
- PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi,
+ PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi,
pdfInfo.pdfDoc,
pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
pdfInfo.currentFontName, pdfInfo.currentFontSize);
graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
if (!resolutionScaling.isIdentity()) {
- pdfInfo.currentStream.add("%resolution scaling for " + uaResolution
+ pdfInfo.currentStream.add("%resolution scaling for " + uaResolution
+ " -> " + deviceResolution + "\n");
pdfInfo.currentStream.add(
CTMHelper.toPDFString(resolutionScaling, false) + " cm\n");
graphics.scale(1 / s, 1 / s);
}
-
+
pdfInfo.currentStream.add("%SVG start\n");
//Save state and update coordinate system for the SVG image
pdfInfo.pdfState.push();
pdfInfo.pdfState.concatenate(imageTransform);
- //Now that we have the complete transformation matrix for the image, we can update the
+ //Now that we have the complete transformation matrix for the image, we can update the
//transformation matrix for the AElementBridge.
PDFAElementBridge aBridge = (PDFAElementBridge)ctx.getBridge(
SVGDOMImplementation.SVG_NAMESPACE_URI, SVGConstants.SVG_A_TAG);
@@ -272,7 +272,7 @@
renderer.restoreGraphicsState();
pdfInfo.currentStream.add("%SVG end\n");
}
-
+
/** {@inheritDoc} */
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof PDFRenderer);
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org