aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java
index aca45f0..deab953 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java
@@ -17,7 +17,9 @@ import at.knowcenter.wag.egov.egiz.sig.SignatureObject;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.AcroFields;
import com.lowagie.text.pdf.PdfDictionary;
+import com.lowagie.text.pdf.PdfFormField;
import com.lowagie.text.pdf.PdfName;
+import com.lowagie.text.pdf.PdfNumber;
import com.lowagie.text.pdf.PdfObject;
import com.lowagie.text.pdf.PdfSignature;
import com.lowagie.text.pdf.PdfSignatureAppearance;
@@ -55,7 +57,7 @@ public class AdobeSignatureHelper {
* @throws PresentableException
*/
public static void createAdobeSignatureField(PdfStamper stamper, SignatorInformation si,
- SignatureObject so, ActualTablePos atp) throws PresentableException {
+ SignatureObject so, ActualTablePos atp, StructContentHelper structHelper) throws PresentableException {
try {
logger.debug("Creating adobe signature field.");
@@ -141,6 +143,14 @@ public class AdobeSignatureHelper {
// content element is mandatory but empty
HashMap exc = new HashMap();
exc.put(PdfName.CONTENTS, new Integer(2));
+
+ PdfNumber parentNum = structHelper.buildAnnotStructParent();
+ if (parentNum != null) {
+ PdfFormField sigField = PdfFormField.createSignature(stamper.getWriter());
+ sap.setSigFormField(sigField);
+ sigField.put(PdfName.STRUCTPARENT, parentNum);
+ structHelper.buildAdobeSigStruct(sigField, finalFieldName);
+ }
sap.preClose(exc); // *2+2
PdfDictionary dic = new PdfDictionary();
@@ -181,7 +191,7 @@ public class AdobeSignatureHelper {
return getDefaultableConfigProperty(sigProfile, ADOBE_VERIFY_URL_KEY, "http://www.signaturpruefung.gv.at");
}
- private static String getDefaultableConfigProperty(String sigProfile, String propName, String defaultValue) {
+ public static String getDefaultableConfigProperty(String sigProfile, String propName, String defaultValue) {
String confVal;
try {
confVal = SettingsReader.getInstance().getSetting(