[jboss-cvs] jboss-seam/src/pdf/org/jboss/seam/pdf ...
Norman Richards
norman.richards at jboss.com
Mon Jan 1 22:40:32 EST 2007
User: nrichards
Date: 07/01/01 22:40:32
Modified: src/pdf/org/jboss/seam/pdf ITextUtils.java
Log:
support metadata
Revision Changes Path
1.5 +22 -1 jboss-seam/src/pdf/org/jboss/seam/pdf/ITextUtils.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ITextUtils.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ITextUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- ITextUtils.java 1 Jan 2007 00:27:48 -0000 1.4
+++ ITextUtils.java 2 Jan 2007 03:40:32 -0000 1.5
@@ -4,6 +4,7 @@
import com.lowagie.text.pdf.*;
import java.awt.Color;
+import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
@@ -62,6 +63,16 @@
return Element.ALIGN_UNDEFINED;
}
+ public static Rectangle pageSizeValue(String name) {
+ try {
+ Field field = PageSize.class.getDeclaredField(name.toUpperCase());
+ return (Rectangle) field.get(null);
+ } catch (Exception e) {
+ throw new RuntimeException("Can't find page size " + name);
+ }
+ }
+
+
/**
* return a color value from a string specification.
*/
@@ -72,4 +83,14 @@
}
return color;
}
+
+ public static float[] stringToFloatArray(String widths) {
+ String[] parts = widths.split("\\s");
+ float[] values = new float[parts.length];
+ for (int i=0;i<parts.length;i++) {
+ values[i] = Float.valueOf(parts[i]);
+ }
+
+ return values;
+ }
}
More information about the jboss-cvs-commits
mailing list