aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/Placeholder.java10
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/SplitStrings.java20
2 files changed, 12 insertions, 18 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/Placeholder.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/Placeholder.java
index 9155f15..fce5dea 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/Placeholder.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/Placeholder.java
@@ -24,6 +24,8 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import javax.sound.midi.SysexMessage;
+
import org.apache.commons.codec.net.URLCodec;
import org.apache.log4j.Logger;
@@ -352,7 +354,7 @@ public abstract class Placeholder
*/
protected static boolean canBreakAfter(byte character)
{
- return (character == ' ' || character == ',' || character == ';' || character == '-');
+ return (character == ' ' || character == ',' || character == ';' || character == '-' || character == '\n') ;
}
/**
@@ -532,6 +534,7 @@ public abstract class Placeholder
{
byte data = bytes[index];
+
// byte [] escaped_data = escapeByte(data);
baos.write(data);
@@ -541,10 +544,13 @@ public abstract class Placeholder
}
}
+ System.err.println("token: " + baos.toString());
return baos.toByteArray();
}
- protected static byte[] escapeToken(byte[] token) throws IOException
+
+
+protected static byte[] escapeToken(byte[] token) throws IOException
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/SplitStrings.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/SplitStrings.java
index 45afaf7..b407b61 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/SplitStrings.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/SplitStrings.java
@@ -112,29 +112,17 @@ public class SplitStrings
*/
public void write(byte[] data)
{
- data = tryProcessNewline(data);
if (!fits(data))
{
throw new IllegalArgumentException("The data doesn't fit in.");
}
System.arraycopy(data, 0, this.pdf, this.strings[this.cur_string].string_start + this.cur_pos, data.length);
-
this.cur_pos += data.length;
- }
-
- /**
- * Process starting \n token if found
- * @param data
- * @return
- */
- private byte[] tryProcessNewline(byte[] data) {
- if (data.length > 0 && data[0] == '\n') {
- // new line token \n found
- newline();
- data = ArrayUtils.subarray(data, 1, data.length);
- }
- return data;
+
+ if (data[data.length-1] == '\n') {
+ newline();
+ }
}
/**