You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2008/07/24 11:37:16 UTC
svn commit: r679326 [20/33] - in /xmlgraphics/fop/trunk:
examples/embedding/java/embedding/ examples/embedding/java/embedding/events/
examples/embedding/java/embedding/intermediate/
examples/embedding/java/embedding/model/ examples/embedding/java/embed...
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFArray.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFArray.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFArray.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFArray.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -88,10 +88,10 @@
public PDFArray(PDFObject parent, Collection values) {
/* generic creation of PDF object */
super(parent);
-
+
this.values.addAll(values);
}
-
+
/**
* Create the array object
* @param parent the array's parent if any
@@ -100,12 +100,12 @@
public PDFArray(PDFObject parent, Object[] values) {
/* generic creation of PDF object */
super(parent);
-
+
for (int i = 0, c = values.length; i < c; i++) {
this.values.add(values[i]);
}
}
-
+
/**
* Returns the length of the array
* @return the length of the array
@@ -113,7 +113,7 @@
public int length() {
return this.values.size();
}
-
+
/**
* Sets an entry at a given location.
* @param index the index of the value to set
@@ -122,7 +122,7 @@
public void set(int index, Object obj) {
this.values.set(index, obj);
}
-
+
/**
* Sets an entry at a given location.
* @param index the index of the value to set
@@ -131,7 +131,7 @@
public void set(int index, double value) {
this.values.set(index, new Double(value));
}
-
+
/**
* Gets an entry at a given location.
* @param index the index of the value to set
@@ -140,7 +140,7 @@
public Object get(int index) {
return this.values.get(index);
}
-
+
/**
* Adds a new value to the array.
* @param obj the value
@@ -154,7 +154,7 @@
}
this.values.add(obj);
}
-
+
/**
* Adds a new value to the array.
* @param value the value
@@ -162,7 +162,7 @@
public void add(double value) {
this.values.add(new Double(value));
}
-
+
/** {@inheritDoc} */
protected int output(OutputStream stream) throws IOException {
CountingOutputStream cout = new CountingOutputStream(stream);
@@ -170,7 +170,7 @@
if (hasObjectNumber()) {
writer.write(getObjectID());
}
-
+
writer.write('[');
for (int i = 0; i < values.size(); i++) {
if (i > 0) {
@@ -180,13 +180,13 @@
formatObject(obj, cout, writer);
}
writer.write(']');
-
+
if (hasObjectNumber()) {
writer.write("\nendobj\n");
}
-
+
writer.flush();
return cout.getCount();
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDFont.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDFont.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDFont.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import org.apache.fop.fonts.CIDFontType;
@@ -60,8 +60,8 @@
int[] w, String registry, String ordering,
int supplement, PDFCIDFontDescriptor descriptor) {
- this(basefont, cidtype, dw,
- new PDFWArray(w),
+ this(basefont, cidtype, dw,
+ new PDFWArray(w),
new PDFCIDSystemInfo(registry, ordering, supplement),
descriptor);
}
@@ -79,8 +79,8 @@
int[] w, PDFCIDSystemInfo systemInfo,
PDFCIDFontDescriptor descriptor) {
- this(basefont, cidtype, dw,
- new PDFWArray(w),
+ this(basefont, cidtype, dw,
+ new PDFWArray(w),
systemInfo,
descriptor);
}
@@ -189,7 +189,7 @@
} else if (cidFontType == CIDFontType.CIDTYPE2) {
return cidFontType.getName();
} else {
- throw new IllegalArgumentException("Unsupported CID font type: "
+ throw new IllegalArgumentException("Unsupported CID font type: "
+ cidFontType.getName());
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDFontDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDFontDescriptor.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDFontDescriptor.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDFontDescriptor.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
// based on work by Takayuki Takeuchi
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDSystemInfo.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDSystemInfo.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDSystemInfo.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIDSystemInfo.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
// based on work by Takayuki Takeuchi
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCMap.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCMap.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCMap.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCMap.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -421,7 +421,7 @@
protected CMapBuilder createCMapBuilder(Writer writer) {
return new CMapBuilder(writer, this.name);
}
-
+
/** {@inheritDoc} */
protected int output(OutputStream stream) throws IOException {
CMapBuilder builder = createCMapBuilder(getBufferWriter());
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCharProcs.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCharProcs.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCharProcs.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCharProcs.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,11 +16,11 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.util.Map;
-import java.util.HashMap;
+import java.util.HashMap;
/**
* class representing a /CharProcs dictionary for Type3 fonts.
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColor.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColor.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColor.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.awt.Color;
@@ -44,11 +44,11 @@
private double magenta = -1.0;
private double yellow = -1.0;
private double black = -1.0;
-
+
// TODO - It would probably be better to reorganize PDFPathPaint/PDFColor/PDFColorSpace
- // class hierarchy. However, at this early stages of my FOP understanding, I can
- // not really oversee the consequences of such a switch (nor whether it would be
- // appropriate).
+ // class hierarchy. However, at this early stages of my FOP understanding, I can
+ // not really oversee the consequences of such a switch (nor whether it would be
+ // appropriate).
private ColorExt colorExt = null;
/**
@@ -66,24 +66,24 @@
this.green = theGreen;
this.blue = theBlue;
}
-
+
/**
* Create PDFColor for the given document and based on the java.awt.Color object
- *
- * In case the java.awt.Color is an instance of the ColorExt class a PDFICCStream is added to
+ *
+ * In case the java.awt.Color is an instance of the ColorExt class a PDFICCStream is added to
* the PDFDocument that is being created
- *
+ *
* @param pdfDoc PDFDocument that is being created
* @param col Color object from which to create this PDFColor
*/
public PDFColor(PDFDocument pdfDoc, Color col) {
this(col);
// TODO - 1) There is a potential conflict when FOP and Batik elements use the same color
- // profile name for different profiles.
- // 2) In case the same color profile is used with different names it will be
+ // profile name for different profiles.
+ // 2) In case the same color profile is used with different names it will be
// included multiple times in the PDF
//
- if (colorExt != null
+ if (colorExt != null
&& pdfDoc.getResources().getColorSpace(colorExt.getIccProfileName()) == null) {
PDFICCStream pdfIccStream = new PDFICCStream();
ColorSpace ceCs = colorExt.getOrigColorSpace();
@@ -98,17 +98,17 @@
pdfDoc.getFactory().makeICCBasedColorSpace(
null, colorExt.getIccProfileName(), pdfIccStream);
if (log.isInfoEnabled()) {
- log.info("Adding PDFICCStream " + colorExt.getIccProfileName()
+ log.info("Adding PDFICCStream " + colorExt.getIccProfileName()
+ " for " + colorExt.getIccProfileSrc());
}
}
}
-
+
/**
* Create a PDF color from a java.awt.Color object.
- *
+ *
* Different Color objects are handled differently. Cases recognized are.
- *
+ *
* 1. CMYK color
* 2. ColorExt color
* 3. 'Normal' java.awt.Color (RGB case assumed)
@@ -120,12 +120,12 @@
ColorExt ce = null;
if (col instanceof ColorExt) {
ce = (ColorExt)col;
- cs = ce.getOrigColorSpace();
+ cs = ce.getOrigColorSpace();
}
if (cs != null && cs instanceof CMYKColorSpace) {
// CMYK case
this.colorSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_CMYK);
- float[] cmyk = (ce == null
+ float[] cmyk = (ce == null
? col.getColorComponents(null)
: ce.getOriginalColorComponents());
this.cyan = cmyk[0];
@@ -151,7 +151,7 @@
this.blue = comps[2];
}
}
-
+
/**
* Create a PDF color with int values ranging from 0 to 255
*
@@ -239,11 +239,11 @@
return (this.blue);
}
- /**
+ /**
* Get the red integer component.
- *
- * @return the red integer value
- */
+ *
+ * @return the red integer value
+ */
public int red255() {
return (int)(this.red * 255d);
}
@@ -251,7 +251,7 @@
/**
* Get the green integer component.
*
- * @return the green integer value
+ * @return the green integer value
*/
public int green255() {
return (int)(this.green * 255d);
@@ -260,7 +260,7 @@
/**
* Get the blue integer component.
*
- * @return the blue integer value
+ * @return the blue integer value
*/
public int blue255() {
return (int)(this.blue * 255d);
@@ -269,7 +269,7 @@
/**
* Get the cyan component.
*
- * @return the cyan double value
+ * @return the cyan double value
*/
public double cyan() {
return (this.cyan);
@@ -278,7 +278,7 @@
/**
* Get the magenta component.
*
- * @return the magenta double value
+ * @return the magenta double value
*/
public double magenta() {
return (this.magenta);
@@ -287,7 +287,7 @@
/**
* Get the yellow component.
*
- * @return the yellow double value
+ * @return the yellow double value
*/
public double yellow() {
return (this.yellow);
@@ -296,7 +296,7 @@
/**
* Get the black component.
*
- * @return the black double value
+ * @return the black double value
*/
public double black() {
return (this.black);
@@ -553,7 +553,7 @@
}
PDFColor color = (PDFColor)obj;
- if (color.red == this.red
+ if (color.red == this.red
&& color.green == this.green
&& color.blue == this.blue) {
return true;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColorSpace.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColorSpace.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColorSpace.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColorSpace.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,14 +16,14 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
* PDF Color space.
*/
public interface PDFColorSpace {
-
+
/**
* Get the number of color components for this colorspace
* @return the number of components
@@ -32,18 +32,18 @@
/** @return the name of the color space */
String getName();
-
+
/**
- * @return true if the color space is a device-dependent color space (like DeviceRGB,
+ * @return true if the color space is a device-dependent color space (like DeviceRGB,
* DeviceCMYK and DeviceGray)
*/
boolean isDeviceColorSpace();
-
+
/** @return true if the color space is an RGB color space */
boolean isRGBColorSpace();
/** @return true if the color space is an CMYK color space */
boolean isCMYKColorSpace();
/** @return true if the color space is an Gray color space */
boolean isGrayColorSpace();
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFConformanceException.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFConformanceException.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFConformanceException.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFConformanceException.java Thu Jul 24 02:35:34 2008
@@ -33,7 +33,7 @@
public PDFConformanceException() {
super();
}
-
+
/**
* Constructs an PDFConformanceException with the specified detail
* message. A detail message is a String that describes this particular
@@ -43,5 +43,5 @@
public PDFConformanceException(String message) {
super(message);
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDestination.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDestination.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDestination.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDestination.java Thu Jul 24 02:35:34 2008
@@ -55,15 +55,15 @@
protected int output(OutputStream stream) throws IOException {
CountingOutputStream cout = new CountingOutputStream(stream);
Writer writer = PDFDocument.getWriterFor(cout);
-
+
formatObject(getIDRef(), cout, writer);
writer.write(' ');
formatObject(goToReference, cout, writer);
-
+
writer.flush();
return cout.getCount();
}
-
+
/**
* Sets the GoToReference in the associated DestinationData object.
*
@@ -120,7 +120,7 @@
if (dest.getIDRef().equals(this.getIDRef())) {
return true;
}
-
+
return false;
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDeviceColorSpace.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDeviceColorSpace.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDeviceColorSpace.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDeviceColorSpace.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,14 +16,14 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
* Represents a device-specific color space. Used for mapping DeviceRGB, DeviceCMYK and DeviceGray.
*/
public class PDFDeviceColorSpace implements PDFColorSpace {
-
+
private int numComponents;
/**
@@ -136,5 +136,5 @@
public boolean isGrayColorSpace() {
return getColorSpace() == DEVICE_GRAY;
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDictionary.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDictionary.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDictionary.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDictionary.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -32,7 +32,7 @@
* Class representing a PDF dictionary object
*/
public class PDFDictionary extends PDFObject {
-
+
/**
* the entry map
*/
@@ -43,7 +43,7 @@
* "entries", always make sure you adjust this list accordingly.
*/
protected List order = new java.util.ArrayList();
-
+
/**
* Create a new dictionary object.
*/
@@ -76,7 +76,7 @@
}
this.entries.put(name, value);
}
-
+
/**
* Puts a new name/value pair.
* @param name the name
@@ -88,7 +88,7 @@
}
this.entries.put(name, new Integer(value));
}
-
+
/**
* Returns the value given a name.
* @param name the name of the value
@@ -97,7 +97,7 @@
public Object get(String name) {
return this.entries.get(name);
}
-
+
/** {@inheritDoc} */
protected int output(OutputStream stream) throws IOException {
CountingOutputStream cout = new CountingOutputStream(stream);
@@ -105,17 +105,17 @@
if (hasObjectNumber()) {
writer.write(getObjectID());
}
-
+
writeDictionary(cout, writer);
if (hasObjectNumber()) {
writer.write("\nendobj\n");
}
-
+
writer.flush();
return cout.getCount();
}
-
+
/**
* Writes the contents of the dictionary to a StringBuffer.
* @param out the OutputStream (for binary content)
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -65,13 +65,13 @@
public class PDFDocument {
private static final Integer LOCATION_PLACEHOLDER = new Integer(0);
-
+
/** Integer constant to represent PDF 1.3 */
public static final int PDF_VERSION_1_3 = 3;
/** Integer constant to represent PDF 1.4 */
public static final int PDF_VERSION_1_4 = 4;
-
+
/**
* the encoding to use when converting strings to PDF commandos.
*/
@@ -109,12 +109,12 @@
/** Indicates what PDF version is active */
protected int pdfVersion = PDF_VERSION_1_4;
-
+
/**
* Indicates which PDF profiles are active (PDF/A, PDF/X etc.)
*/
protected PDFProfile pdfProfile = new PDFProfile(this);
-
+
/**
* the /Root object
*/
@@ -268,7 +268,7 @@
public int getPDFVersion() {
return this.pdfVersion;
}
-
+
/** @return the String representing the active PDF version */
public String getPDFVersionString() {
switch (getPDFVersion()) {
@@ -285,7 +285,7 @@
public PDFProfile getProfile() {
return this.pdfProfile;
}
-
+
/**
* Returns the factory for PDF objects.
* @return PDFFactory the factory
@@ -332,7 +332,7 @@
throw new Error("JVM doesn't support " + ENCODING + " encoding!");
}
}
-
+
/**
* set the producer of the document
*
@@ -344,7 +344,7 @@
/**
* Set the creation date of the document.
- *
+ *
* @param date Date to be stored as creation date in the PDF.
*/
public void setCreationDate(Date date) {
@@ -775,7 +775,7 @@
}
this.destinations.add(destination);
}
-
+
/**
* Gets the list of named destinations.
*
@@ -849,7 +849,7 @@
PDFStream cont,
PDFReference formres,
String key) {
-
+
// check if already created
PDFFormXObject xObject = (PDFFormXObject)xObjectsMap.get(key);
if (xObject != null) {
@@ -858,7 +858,7 @@
}
return xObject;
}
-
+
xObject = new PDFFormXObject(
++this.xObjectCount,
cont,
@@ -954,7 +954,7 @@
this.position = 0;
getProfile().verifyPDFVersion();
-
+
byte[] pdf = encode("%PDF-" + getPDFVersionString() + "\n");
stream.write(pdf);
this.position += pdf.length;
@@ -991,7 +991,7 @@
}
}
}
-
+
/**
* write the trailer
*
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncoding.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncoding.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncoding.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncoding.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
// Java
@@ -48,7 +48,7 @@
/** the set of predefined encodings that can be assumed present in a PDF viewer */
private static final Set PREDEFINED_ENCODINGS;
-
+
static {
Set encodings = new java.util.HashSet();
encodings.add(STANDARD_ENCODING);
@@ -81,7 +81,7 @@
public static boolean isPredefinedEncoding(String name) {
return PREDEFINED_ENCODINGS.contains(name);
}
-
+
/**
* Creates and returns a new DifferencesBuilder instance for constructing the Differences
* array.
@@ -98,15 +98,15 @@
public void setDifferences(PDFArray differences) {
put("Differences", differences);
}
-
+
/**
* Builder class for constructing the Differences array.
*/
public class DifferencesBuilder {
-
+
private PDFArray differences = new PDFArray();
private int currentCode = -1;
-
+
/**
* Start a new difference.
* @param code the starting code index inside the encoding
@@ -117,7 +117,7 @@
this.differences.add(new Integer(code));
return this;
}
-
+
/**
* Adds a character name to the current difference.
* @param name the character name
@@ -130,7 +130,7 @@
this.differences.add(new PDFName(name));
return this;
}
-
+
/**
* Indicates whether any differences have been recorded.
* @return true if there are differences.
@@ -138,7 +138,7 @@
public boolean hasDifferences() {
return (this.differences.length() > 0);
}
-
+
/**
* Creates and returns the PDFArray representing the Differences entry.
* @return the Differences entry
@@ -147,7 +147,7 @@
return this.differences;
}
}
-
+
/*
* example (p. 214)
* 25 0 obj
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryption.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryption.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryption.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryption.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
@@ -39,9 +39,9 @@
/**
* Adds a PDFFilter to the PDFStream object
* @param stream the stream to add an encryption filter to
- */
+ */
void applyFilter(AbstractPDFStream stream);
-
+
/**
* Encrypt an array of bytes using a reference PDFObject for calculating
* the encryption key.
@@ -50,7 +50,7 @@
* @return byte[] the encrypted data
*/
byte[] encrypt(byte[] data, PDFObject refObj);
-
+
/**
* Returns the trailer entry for encryption.
* @return the trailer entry
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionJCE.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionJCE.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionJCE.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionJCE.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
// Java
@@ -40,18 +40,18 @@
*
*/
public class PDFEncryptionJCE extends PDFObject implements PDFEncryption {
-
+
private class EncryptionFilter extends PDFFilter {
private PDFEncryptionJCE encryption;
private int number;
private int generation;
- /**
+ /**
* The constructor for the internal PDFEncryptionJCE filter
* @param encryption The encryption object to use
* @param number The number of the object to be encrypted
* @param generation The generation of the object to be encrypted
- */
+ */
public EncryptionFilter(PDFEncryptionJCE encryption,
int number, int generation) {
super();
@@ -62,7 +62,7 @@
+ number + " and generation " + generation);
}
- /**
+ /**
* Return a PDF string representation of the filter. In this
* case no filter name is passed.
* @return The filter name, blank in this case
@@ -71,7 +71,7 @@
return "";
}
- /**
+ /**
* Return a parameter dictionary for this filter, or null
* @return The parameter dictionary. In this case, null.
*/
@@ -79,7 +79,7 @@
return null;
}
- /**
+ /**
* Encode the given data with the filter
* @param data The data to be encrypted
* @return The encrypted data
@@ -87,43 +87,43 @@
public byte[] encode(byte[] data) {
return encryption.encryptData(data, number, generation);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
- public void encode(InputStream in, OutputStream out, int length)
+ public void encode(InputStream in, OutputStream out, int length)
throws IOException {
byte[] buffer = new byte[length];
in.read(buffer);
buffer = encode(buffer);
out.write(buffer);
}
-
+
/**
* {@inheritDoc}
*/
public OutputStream applyFilter(OutputStream out) throws IOException {
- return new CipherOutputStream(out,
+ return new CipherOutputStream(out,
encryption.initCipher(number, generation));
}
}
- private static final char [] PAD
+ private static final char [] PAD
= {0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41,
- 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
- 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80,
+ 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
+ 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80,
0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A};
-
- /** Value of PRINT permission */
+
+ /** Value of PRINT permission */
public static final int PERMISSION_PRINT = 4;
- /** Value of content editting permission */
+ /** Value of content editting permission */
public static final int PERMISSION_EDIT_CONTENT = 8;
- /** Value of content extraction permission */
+ /** Value of content extraction permission */
public static final int PERMISSION_COPY_CONTENT = 16;
- /** Value of annotation editting permission */
+ /** Value of annotation editting permission */
public static final int PERMISSION_EDIT_ANNOTATIONS = 32;
-
+
// Encryption tools
private MessageDigest digest = null;
//private Cipher cipher = null;
@@ -185,14 +185,14 @@
}
// Internal procedures
-
+
private byte[] prepPassword(String password) {
byte[] obuffer = new byte[32];
byte[] pbuffer = password.getBytes();
int i = 0;
int j = 0;
-
+
while (i < obuffer.length && i < pbuffer.length) {
obuffer[i] = pbuffer[i];
i++;
@@ -204,34 +204,34 @@
return obuffer;
}
- /**
+ /**
* Returns the document file ID
* @return The file ID
- */
+ */
public byte[] getFileID() {
if (fileID == null) {
fileID = new byte[16];
random.nextBytes(fileID);
}
-
+
return fileID;
}
-
- /**
+
+ /**
* This method returns the indexed file ID
* @param index The index to access the file ID
* @return The file ID
- */
+ */
public String getFileID(int index) {
if (index == 1) {
return PDFText.toHex(getFileID());
}
-
+
byte[] id = new byte[16];
random.nextBytes(id);
return PDFText.toHex(id);
}
-
+
private byte[] encryptWithKey(byte[] data, byte[] key) {
try {
final Cipher c = initCipher(key);
@@ -242,7 +242,7 @@
throw new IllegalStateException(e.getMessage());
}
}
-
+
private Cipher initCipher(byte[] key) {
try {
Cipher c = Cipher.getInstance("RC4");
@@ -257,7 +257,7 @@
throw new UnsupportedOperationException(e.getMessage());
}
}
-
+
private Cipher initCipher(int number, int generation) {
byte[] hash = calcHash(number, generation);
int size = hash.length;
@@ -265,12 +265,12 @@
byte[] key = calcKey(hash, size);
return initCipher(key);
}
-
+
private byte[] encryptWithHash(byte[] data, byte[] hash, int size) {
hash = digest.digest(hash);
- byte[] key = calcKey(hash, size);
-
+ byte[] key = calcKey(hash, size);
+
return encryptWithKey(data, key);
}
@@ -283,19 +283,19 @@
return key;
}
- /**
+ /**
* This method initializes the encryption algorithms and values
- */
+ */
public void init() {
// Generate the owner value
byte[] oValue;
if (params.getOwnerPassword().length() > 0) {
oValue = encryptWithHash(
- prepPassword(params.getUserPassword()),
+ prepPassword(params.getUserPassword()),
prepPassword(params.getOwnerPassword()), 5);
} else {
oValue = encryptWithHash(
- prepPassword(params.getUserPassword()),
+ prepPassword(params.getUserPassword()),
prepPassword(params.getUserPassword()), 5);
}
@@ -330,12 +330,12 @@
for (int i = 0; i < 5; i++) {
this.encryptionKey[i] = hash[i];
}
-
+
// Create the user value
byte[] uValue = encryptWithKey(prepPassword(""), this.encryptionKey);
-
+
// Create the dictionary
- this.dictionary = getObjectID()
+ this.dictionary = getObjectID()
+ "<< /Filter /Standard\n"
+ "/V 1\n"
+ "/R 2\n"
@@ -347,18 +347,18 @@
+ "endobj\n";
}
- /**
+ /**
* This method encrypts the passed data using the generated keys.
* @param data The data to be encrypted
* @param number The block number
* @param generation The block generation
* @return The encrypted data
- */
+ */
public byte[] encryptData(byte[] data, int number, int generation) {
if (this.encryptionKey == null) {
throw new IllegalStateException("PDF Encryption has not been initialized");
}
- byte[] hash = calcHash(number, generation);
+ byte[] hash = calcHash(number, generation);
return encryptWithHash(data, hash, hash.length);
}
@@ -376,26 +376,26 @@
private byte[] calcHash(int number, int generation) {
byte[] hash = new byte[this.encryptionKey.length + 5];
-
+
int i = 0;
while (i < this.encryptionKey.length) {
hash[i] = this.encryptionKey[i]; i++;
}
-
+
hash[i++] = (byte) (number >>> 0);
hash[i++] = (byte) (number >>> 8);
hash[i++] = (byte) (number >>> 16);
hash[i++] = (byte) (generation >>> 0);
hash[i++] = (byte) (generation >>> 8);
- return hash;
+ return hash;
}
- /**
+ /**
* Creates PDFFilter for the encryption object
* @param number The object number
* @param generation The objects generation
* @return The resulting filter
- */
+ */
public PDFFilter makeFilter(int number, int generation) {
return new EncryptionFilter(this, number, generation);
}
@@ -403,12 +403,12 @@
/**
* Adds a PDFFilter to the PDFStream object
* @param stream the stream to add an encryption filter to
- */
+ */
public void applyFilter(AbstractPDFStream stream) {
stream.getFilterList().addFilter(
this.makeFilter(stream.getObjectNumber(), stream.getGeneration()));
}
-
+
/**
* Represent the object in PDF
*
@@ -418,7 +418,7 @@
if (this.dictionary == null) {
throw new IllegalStateException("PDF Encryption has not been initialized");
}
-
+
return encode(this.dictionary);
}
@@ -426,7 +426,7 @@
* {@inheritDoc}
*/
public String getTrailerEntry() {
- return "/Encrypt " + getObjectNumber() + " "
+ return "/Encrypt " + getObjectNumber() + " "
+ getGeneration() + " R\n"
+ "/ID[" + getFileID(1) + getFileID(2) + "]\n";
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionManager.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionManager.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.lang.reflect.InvocationTargetException;
@@ -48,7 +48,7 @@
return false;
}
}
-
+
/**
* Checks whether the necessary algorithms are available.
* @return boolean True if all necessary algorithms are present
@@ -71,7 +71,7 @@
return true;
}
}
-
+
/**
* Sets up PDF encryption if PDF encryption is requested by registering
@@ -80,7 +80,7 @@
* @param params the PDF encryption params or null to disable encryption
* @param pdf the PDF document to setup encryption for
*/
- public static void setupPDFEncryption(PDFEncryptionParams params,
+ public static void setupPDFEncryption(PDFEncryptionParams params,
PDFDocument pdf) {
if (pdf == null) {
throw new NullPointerException("PDF document must not be null");
@@ -101,7 +101,7 @@
pdf.setEncryption(params);
}
}
-
+
/**
* Creates a new PDFEncryption instance if PDF encryption is available.
* @param objnum PDF object number
@@ -112,9 +112,9 @@
public static PDFEncryption newInstance(int objnum, PDFEncryptionParams params) {
try {
Class clazz = Class.forName("org.apache.fop.pdf.PDFEncryptionJCE");
- Method makeMethod = clazz.getMethod("make",
+ Method makeMethod = clazz.getMethod("make",
new Class[] {int.class, PDFEncryptionParams.class});
- Object obj = makeMethod.invoke(null,
+ Object obj = makeMethod.invoke(null,
new Object[] {new Integer(objnum), params});
return (PDFEncryption)obj;
} catch (ClassNotFoundException e) {
@@ -135,5 +135,5 @@
return null;
}
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionParams.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionParams.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionParams.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFEncryptionParams.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
@@ -30,7 +30,7 @@
private boolean allowCopyContent = true;
private boolean allowEditContent = true;
private boolean allowEditAnnotations = true;
-
+
/**
* Creates a new instance.
* @param userPassword the user password
@@ -52,14 +52,14 @@
setAllowEditContent(allowEditContent);
setAllowEditAnnotations(allowEditAnnotations);
}
-
+
/**
* Default constructor initializing to default values.
*/
public PDFEncryptionParams() {
//nop
}
-
+
/**
* Indicates whether copying content is allowed.
* @return true if copying is allowed
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFactory.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFactory.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFactory.java Thu Jul 24 02:35:34 2008
@@ -913,8 +913,8 @@
PDFNameTreeNode node = new PDFNameTreeNode();
getDocument().registerObject(node);
return node;
- }
-
+ }
+
/* ========================= links ===================================== */
// Some of the "yoffset-only" functions in this part are obsolete and can
// possibly be removed or deprecated. Some are still called by PDFGraphics2D
@@ -1250,7 +1250,7 @@
nonBase14.setWidthMetrics(firstChar,
lastChar,
new PDFArray(null, metrics.getWidths()));
-
+
//Handle encoding
SingleByteEncoding mapping = singleByteFont.getEncoding();
if (singleByteFont.isSymbolicFont()) {
@@ -1265,10 +1265,10 @@
} else {
font.setEncoding((String)pdfEncoding);
}
-
+
/* JM: What I thought would be a necessity with custom encodings turned out to
* be a bug in Adobe Acrobat 8. The following section just demonstrates how
- * to generate a ToUnicode CMap for a Type 1 font.
+ * to generate a ToUnicode CMap for a Type 1 font.
PDFCMap cmap = new PDFToUnicodeCMap(mapping.getUnicodeCharMap(),
"fop-ucs-H",
new PDFCIDSystemInfo("Adobe", "Identity", 0));
@@ -1276,7 +1276,7 @@
nonBase14.setToUnicode(cmap);
*/
}
-
+
//Handle additional encodings (characters outside the primary encoding)
if (singleByteFont.hasAdditionalEncodings()) {
for (int i = 0, c = singleByteFont.getAdditionalEncodingCount(); i < c; i++) {
@@ -1573,7 +1573,7 @@
/**
* Create a PDFICCStream
* @see PDFImageXObject
- * @see org.apache.fop.pdf.PDFDeviceColorSpace
+ * @see org.apache.fop.pdf.PDFDeviceColorSpace
* @return the new PDF ICC stream object
*/
public PDFICCStream makePDFICCStream() {
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFileSpec.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFileSpec.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFileSpec.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFileSpec.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
@@ -47,9 +47,9 @@
* {@inheritDoc}
*/
public String toPDFString() {
- return getObjectID()
- + "<<\n/Type /FileSpec\n"
- + "/F (" + this.filename + ")\n"
+ return getObjectID()
+ + "<<\n/Type /FileSpec\n"
+ + "/F (" + this.filename + ")\n"
+ ">>\nendobj\n";
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilter.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilter.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,10 +16,10 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
-import java.io.OutputStream;
+import java.io.OutputStream;
import java.io.IOException;
/**
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilterException.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilterException.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilterException.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilterException.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilterList.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilterList.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilterList.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFilterList.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -25,7 +25,7 @@
import java.util.Map;
/**
- * This class represents a list of PDF filters to be applied when serializing
+ * This class represents a list of PDF filters to be applied when serializing
* the output of a PDF object.
*/
public class PDFFilterList {
@@ -50,9 +50,9 @@
private List filters = new java.util.ArrayList();
private boolean ignoreASCIIFilters = false;
-
+
private boolean disableAllFilters = false;
-
+
/**
* Default constructor.
* <p>
@@ -61,7 +61,7 @@
public PDFFilterList() {
//nop
}
-
+
/**
* Use this descriptor if you want to have ASCII filters (such as ASCIIHex
* and ASCII85) ignored, for example, when encryption is active.
@@ -78,7 +78,7 @@
public void setDisableAllFilters(boolean value) {
this.disableAllFilters = value;
}
-
+
/**
* Returns true if all filters are disabled.
* @return true if all filters are disabled
@@ -86,7 +86,7 @@
public boolean isDisableAllFilters() {
return this.disableAllFilters;
}
-
+
/**
* Indicates whether the filter list is already initialized.
* @return true if more there are filters present
@@ -111,7 +111,7 @@
filters.add(filter);
}
}
-
+
/**
* Add a filter for compression of the stream by name.
* @param filterType name of the filter to add
@@ -211,7 +211,7 @@
int nonNullParams = populateNamesAndParms(names, parms);
// now build up the filter entries for the dictionary
- return buildFilterEntries(names)
+ return buildFilterEntries(names)
+ (nonNullParams > 0 ? buildDecodeParms(parms) : "");
}
return "";
@@ -238,7 +238,7 @@
putDecodeParams(dict, parms);
}
}
-
+
private int populateNamesAndParms(List names, List parms) {
// run the filters
int nonNullParams = 0;
@@ -247,7 +247,7 @@
// place the names in our local vector in reverse order
if (filter.getName().length() > 0) {
names.add(0, filter.getName());
- PDFObject param = filter.getDecodeParms();
+ PDFObject param = filter.getDecodeParms();
if (param != null) {
parms.add(0, param);
nonNullParams++;
@@ -297,7 +297,7 @@
}
}
}
-
+
private String buildDecodeParms(List parms) {
StringBuffer sb = new StringBuffer();
boolean needParmsEntry = false;
@@ -346,9 +346,9 @@
}
}
}
-
+
/**
- * Applies all registered filters as necessary. The method returns an
+ * Applies all registered filters as necessary. The method returns an
* OutputStream which will receive the filtered contents.
* @param stream raw data output stream
* @return OutputStream filtered output stream
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFont.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFont.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFont.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -37,7 +37,7 @@
/** Internal F-number for each font (it is not written to the font dict) */
private String fontname;
-
+
/**
* create the /Font object
*
@@ -74,7 +74,7 @@
put("Encoding", new PDFName(encoding));
}
}
-
+
/**
* Sets the Encoding value of the font.
* @param encoding the encoding
@@ -84,7 +84,7 @@
put("Encoding", encoding);
}
}
-
+
/**
* factory method with the basic parameters
*
@@ -122,7 +122,7 @@
public String getName() {
return this.fontname;
}
-
+
/**
* Returns the name of the BaseFont.
* @return the BaseFont
@@ -158,7 +158,7 @@
protected void validate() {
if (getDocumentSafely().getProfile().isFontEmbeddingRequired()) {
if (this.getClass() == PDFFont.class) {
- throw new PDFConformanceException("For " + getDocumentSafely().getProfile()
+ throw new PDFConformanceException("For " + getDocumentSafely().getProfile()
+ ", all fonts, even the base 14"
+ " fonts, have to be embedded! Offending font: " + getBaseFont());
}
@@ -170,5 +170,5 @@
validate();
return super.output(stream);
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontDescriptor.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontDescriptor.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontDescriptor.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import org.apache.fop.fonts.FontType;
@@ -59,16 +59,16 @@
/**
* Set the optional metrics.
- * @param avgWidth The average width of characters in this font.
+ * @param avgWidth The average width of characters in this font.
* The default value is 0.
- * @param maxWidth The maximum width of characters in this font.
+ * @param maxWidth The maximum width of characters in this font.
* The default value is 0.
* @param missingWidth missing width
- * @param leading the desired spacing between lines of text.
+ * @param leading the desired spacing between lines of text.
* The default value is 0.
- * @param stemH The vertical width of the dominant horizontal stems of
+ * @param stemH The vertical width of the dominant horizontal stems of
* glyphs in the font. The default value is 0.
- * @param xHeight The y-coordinate of the top of flat non-ascending
+ * @param xHeight The y-coordinate of the top of flat non-ascending
* lowercase letters, measured from the baseline. The default value is 0.
*/
public void setMetrics(int avgWidth, int maxWidth, int missingWidth,
@@ -119,7 +119,7 @@
}
return stream;
}
-
+
/**
* Sets the CIDSet stream for this font descriptor. (Optional)
* @param cidSet the CIDSet stream
@@ -127,19 +127,19 @@
public void setCIDSet(AbstractPDFStream cidSet) {
put("CIDSet", cidSet);
}
-
+
/** @return the CIDSet stream or null if not applicable */
public AbstractPDFStream getCIDSet() {
return (AbstractPDFStream)get("CIDSet");
}
-
+
/**
* {@inheritDoc}
*/
/*
public String toPDFString() {
StringBuffer p = new StringBuffer(128);
- p.append(getObjectID()
+ p.append(getObjectID()
+ "<< /Type /FontDescriptor"
+ "\n/FontName /" + this.basefont);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontNonBase14.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontNonBase14.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontNonBase14.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontNonBase14.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import org.apache.fop.fonts.FontType;
@@ -70,7 +70,7 @@
public PDFFontDescriptor getDescriptor() {
return (PDFFontDescriptor)get("FontDescriptor");
}
-
+
/**
* Sets a ToUnicode CMap.
* @param cmap the ToUnicode character map
@@ -78,15 +78,15 @@
public void setToUnicode(PDFCMap cmap) {
put("ToUnicode", cmap);
}
-
+
/** {@inheritDoc} */
protected void validate() {
if (getDocumentSafely().getProfile().isFontEmbeddingRequired()) {
if (this.getDescriptor().getFontFile() == null) {
- throw new PDFConformanceException("For " + getDocumentSafely().getProfile()
+ throw new PDFConformanceException("For " + getDocumentSafely().getProfile()
+ ", all fonts have to be embedded!");
}
}
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontTrueType.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontTrueType.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontTrueType.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontTrueType.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import org.apache.fop.fonts.FontType;
@@ -36,7 +36,7 @@
* @param basefont the base font name
* @param encoding the character encoding schema used by the font
*/
- public PDFFontTrueType(String fontname,
+ public PDFFontTrueType(String fontname,
String basefont,
Object encoding) {
super(fontname, FontType.TRUETYPE, basefont, encoding);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType0.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType0.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType0.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType0.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import org.apache.fop.fonts.FontType;
@@ -35,7 +35,7 @@
* @param basefont the base font name
* @param encoding the character encoding schema used by the font
*/
- public PDFFontType0(String fontname,
+ public PDFFontType0(String fontname,
String basefont,
Object encoding) {
super(fontname, FontType.TYPE0, basefont, encoding);
@@ -49,9 +49,9 @@
* @param encoding the character encoding schema used by the font
* @param descendantFonts the CIDFont upon which this font is based
*/
- public PDFFontType0(String fontname,
+ public PDFFontType0(String fontname,
String basefont,
- Object encoding,
+ Object encoding,
PDFCIDFont descendantFonts) {
super(fontname, FontType.TYPE0, basefont, encoding);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType1.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType1.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType1.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType1.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import org.apache.fop.fonts.FontType;
@@ -40,7 +40,7 @@
* @param basefont the base font name
* @param encoding the character encoding schema used by the font
*/
- public PDFFontType1(String fontname,
+ public PDFFontType1(String fontname,
String basefont,
Object encoding) {
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType3.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType3.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType3.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFontType3.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import org.apache.fop.fonts.FontType;
@@ -38,7 +38,7 @@
* @param basefont the base font name
* @param encoding the character encoding schema used by the font
*/
- public PDFFontType3(String fontname,
+ public PDFFontType3(String fontname,
String basefont,
Object encoding) {
super(fontname, FontType.TYPE3, basefont, encoding);
@@ -54,7 +54,7 @@
* @param fontMatrix the font's transformation matrix
* @param charProcs the glyphs' definitions
*/
- public PDFFontType3(String fontname,
+ public PDFFontType3(String fontname,
String basefont,
Object encoding,
PDFRectangle fontBBox, PDFArray fontMatrix,
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFormXObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFormXObject.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFormXObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFormXObject.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
// Java
@@ -32,7 +32,7 @@
* dictionary but a stream of image data.
*/
public class PDFFormXObject extends PDFXObject {
-
+
private PDFStream contents;
private PDFReference resRef;
@@ -49,7 +49,7 @@
put("Name", new PDFName("Form" + xnumber));
this.resRef = resources;
this.contents = contents;
-
+
put("Type", new PDFName("XObject"));
put("Subtype", new PDFName("Form"));
put("FormType", new Integer(1));
@@ -76,7 +76,7 @@
array.set(3, bbox.getHeight());
}
}
-
+
/**
* Returns the bounding box.
* @return the BBox value
@@ -95,7 +95,7 @@
return null;
}
}
-
+
/**
* Sets the Matrix value
* @param at the AffineTransform defining the transformation matrix
@@ -122,7 +122,7 @@
array.set(5, m[5]);
}
}
-
+
/**
* Returns the Matrix value.
* @return the Matrix
@@ -143,7 +143,7 @@
return null;
}
}
-
+
/**
* Used to set the contents of the PDF stream.
* @param data the contents as a byte array
@@ -161,7 +161,7 @@
/** {@inheritDoc} */
protected int output(OutputStream stream) throws IOException {
final int len = super.output(stream);
-
+
//Now that the data has been written, it can be discarded.
this.contents = null;
return len;
@@ -175,6 +175,6 @@
put("Resources", resRef);
super.populateStreamDict(lengthEntry);
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFunction.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFunction.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFunction.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFFunction.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGState.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGState.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGState.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGState.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.util.Map;
@@ -81,7 +81,7 @@
public static final String GSTATE_ALPHA_SOURCE_FLAG = "AIS";
/** Text Knockout Flag (TK, PDF 1.4) */
public static final String GSTATE_TEXT_KNOCKOUT = "TK";
-
+
/** Default GState object */
public static final PDFGState DEFAULT;
@@ -99,7 +99,7 @@
vals.put(op, Boolean.FALSE);
vals.put(OPM, new Integer(1));
vals.put(Font, "");*/
-
+
vals.put(GSTATE_ALPHA_STROKE, new Float(1.0));
vals.put(GSTATE_ALPHA_NONSTROKE, new Float(1.0));
}
@@ -117,7 +117,7 @@
/**
* Sets the alpha value.
* @param val alpha value (0.0 - 1.0)
- * @param fill True if alpha should be set for non-stroking operations,
+ * @param fill True if alpha should be set for non-stroking operations,
* False if for stroking operations
*/
public void setAlpha(float val, boolean fill) {
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGoTo.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGoTo.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGoTo.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGoTo.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.awt.geom.Point2D;
@@ -128,7 +128,7 @@
} else {
dest = "/D [" + this.pageReference + " " + destination + "]\n";
}
- return getObjectID()
+ return getObjectID()
+ "<< /Type /Action\n/S /GoTo\n" + dest
+ ">>\nendobj\n";
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGoToRemote.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGoToRemote.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGoToRemote.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFGoToRemote.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java Thu Jul 24 02:35:34 2008
@@ -33,7 +33,7 @@
private PDFICCStream iccStream;
private String explicitName;
-
+
/**
* Constructs a the ICCBased color space with an explicit name (ex. "DefaultRGB").
* @param explicitName an explicit name or null if a name should be generated
@@ -43,7 +43,7 @@
this.explicitName = explicitName;
this.iccStream = iccStream;
}
-
+
/**
* Constructs a the ICCBased color space.
* @param iccStream the ICC stream to associate with this color space
@@ -51,12 +51,12 @@
public PDFICCBasedColorSpace(PDFICCStream iccStream) {
this(null, iccStream);
}
-
+
/** @return the ICC stream associated with this color space */
public PDFICCStream getICCStream() {
return this.iccStream;
}
-
+
/** {@inheritDoc} */
public int getNumComponents() {
return iccStream.getICCProfile().getNumComponents();
@@ -151,5 +151,5 @@
sRGBProfile.setColorSpace(profile, null);
return sRGBProfile;
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFICCStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFICCStream.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFICCStream.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFICCStream.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.awt.color.ICC_Profile;
@@ -27,7 +27,7 @@
* Special PDFStream for ICC profiles (color profiles).
*/
public class PDFICCStream extends PDFStream {
-
+
private ICC_Profile cp;
private PDFDeviceColorSpace pdfColorSpace;
@@ -53,7 +53,7 @@
public ICC_Profile getICCProfile() {
return this.cp;
}
-
+
/**
* overload the base object method so we don't have to copy
* byte arrays around so much
@@ -65,12 +65,12 @@
this.cp = null; //Free ICC stream when it's not used anymore
return length;
}
-
+
/** {@inheritDoc} */
protected void outputRawStreamData(OutputStream out) throws IOException {
cp.write(out);
}
-
+
/** {@inheritDoc} */
protected void populateStreamDict(Object lengthEntry) {
put("N", cp.getNumComponents());
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFImage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFImage.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFImage.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFImage.java Thu Jul 24 02:35:34 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -111,14 +111,14 @@
/** @return true for CMYK images generated by Adobe Photoshop */
boolean isInverted();
-
+
/**
* Get the PDF Filter to be applied to the image.
*
* @return the PDF Filter or null
*/
PDFFilter getPDFFilter();
-
+
// get the image bytes, and bytes properties
/**
@@ -132,11 +132,11 @@
/**
* Populates the XObject's dictionary with additional values. The values are added to the
* dictionary after all the values obtained from other methods from this interface have
- * been put into the dictionary. That allows to override certain values.
+ * been put into the dictionary. That allows to override certain values.
* @param dict the dictionary to fill
*/
void populateXObjectDictionary(PDFDictionary dict);
-
+
/**
* Get the ICC stream for this image.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org