diff options
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/pdf')
4 files changed, 43 insertions, 0 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AbsoluteTextSignature.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AbsoluteTextSignature.java index 4219475..4b9a2aa 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AbsoluteTextSignature.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AbsoluteTextSignature.java @@ -537,6 +537,14 @@ public class AbsoluteTextSignature {
int block_start_index = ((FoundKey) block.found_keys.get(0)).getStartIndex();
int block_end_index = block.end_index;
+
+ if (block_start_index == 0 && block_end_index == text.length())
+ {
+ // the block is the whole text - the rest text is empty.
+ // This may happen if a (no-text) empty document contains a binary signature.
+ // Then the "signed text" of the binary signature is empty.
+ return "";
+ }
if (block_end_index == text.length())
{
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/ActualTablePos.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/ActualTablePos.java new file mode 100644 index 0000000..f58e9f8 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/ActualTablePos.java @@ -0,0 +1,22 @@ +/**
+ *
+ */
+package at.knowcenter.wag.egov.egiz.pdf;
+
+/**
+ * The actual table position where the signature was placed after signation.
+ * @author wprinz
+ */
+public class ActualTablePos
+{
+ public int page;
+
+ public float x;
+
+ public float y;
+
+ public float width;
+
+ public float height;
+
+}
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java index 677990b..7a5af6b 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java @@ -737,6 +737,14 @@ public abstract class BinarySignature // table_position, content);
content.addTemplate(table_template, pi.getX(), pi.getY() - pdf_table.getTotalHeight());
+
+ ActualTablePos atp = new ActualTablePos();
+ atp.page = pi.getPage();
+ atp.x = pi.getX();
+ atp.y = pi.getY(); // TODO is this correct or flipped?
+ atp.width = pdf_table.getTotalWidth();
+ atp.height = pdf_table.getTotalHeight();
+ iui.actualTablePos = atp;
// For debugging print a 100x100 grid
// {
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/IncrementalUpdateInformation.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/IncrementalUpdateInformation.java index f818f59..77f1150 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/IncrementalUpdateInformation.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/IncrementalUpdateInformation.java @@ -172,5 +172,10 @@ public class IncrementalUpdateInformation implements Serializable * For signing: the profile.
*/
public String signProfile;
+
+ /**
+ * The actual position where the table was written.
+ */
+ public ActualTablePos actualTablePos;
}
|