aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/StructContentHelper.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/StructContentHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/StructContentHelper.java
index 859d2c0..8fe9e62 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/StructContentHelper.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/StructContentHelper.java
@@ -62,6 +62,8 @@ public class StructContentHelper implements StructContentWriter {
private int linkMcid = -1;
private String linkUrlString = null;
private boolean isTagged = false;
+ private Map linkPosMap = new HashMap();
+ private Map tmpMap = new HashMap();
private PdfStamper stamper;
private PdfStamperImp stamperImp;
@@ -234,7 +236,7 @@ public class StructContentHelper implements StructContentWriter {
* @throws PresentableException
*/
void buildVerifyLinkStructData(PdfTemplate sigBlockObj, ActualTablePos atp) throws PresentableException {
- if (!this.isTagged || !this.isLinkMarked()) return;
+ if (!this.isTagged || !this.isLinkMarked() || !isLinkFound()) return;
try {
PdfNumber parentTreeKey = getNewParentTreeKey();
@@ -242,7 +244,7 @@ public class StructContentHelper implements StructContentWriter {
PdfArray annots = obrainAnnotsFromPage();
PdfIndirectReference linkAnnotRef = createLinkAnnot(parentTreeKey, atp);
- annots.add(linkAnnotRef);
+ annots.add(linkAnnotRef);
PdfIndirectReference objr = createObjrStructElem(linkAnnotRef);
PdfIndirectReference mcr = createMcrStructElem(this.linkMcid, sigBlockObj.getIndirectReference());
@@ -280,6 +282,10 @@ public class StructContentHelper implements StructContentWriter {
}
}
+ private boolean isLinkFound() {
+ return this.linkUrlString != null && this.verifyLinkCellPos != null && this.linkPosMap.size() > 0 && this.linkMcid >= 0;
+ }
+
/**
* Build new StructParent entry for signature annotation.
* @return
@@ -412,13 +418,11 @@ public class StructContentHelper implements StructContentWriter {
public void storeCurrentPosAsLink() {
this.verifyLinkCellPos = new Rectangle(this.tempMarkedPos);
}
-
- private Map tmpMap = new HashMap();
+
public void putVal(String key, Object val) {
tmpMap.put(key, val);
}
- private Map linkPosMap;
public void storeVals() {
linkPosMap = new HashMap(tmpMap);
}