diff options
author | pdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-11-03 11:05:02 +0000 |
---|---|---|
committer | pdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-11-03 11:05:02 +0000 |
commit | 770d0ce12e978f03d58bfb1bb7d77078c97b9129 (patch) | |
tree | 0bd9c3dcd29a1efe7b787c47e55ae1dbda4842fc /src/main/java/at/knowcenter/wag/egov | |
parent | 52326ca09c4ca269bf07d2af8b4dd5df682691f5 (diff) | |
download | pdf-as-3-770d0ce12e978f03d58bfb1bb7d77078c97b9129.tar.gz pdf-as-3-770d0ce12e978f03d58bfb1bb7d77078c97b9129.tar.bz2 pdf-as-3-770d0ce12e978f03d58bfb1bb7d77078c97b9129.zip |
added sructcontent/wai support
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@597 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java | 14 |
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(
|