aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas/api/commons
diff options
context:
space:
mode:
authorpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-12-15 16:19:40 +0000
committerpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-12-15 16:19:40 +0000
commit11cea3c04723dbb1f9df0e2c50602913654657f6 (patch)
tree111f0c9a5b2d3b18a1e8346389c2d5252bc69189 /src/main/java/at/gv/egiz/pdfas/api/commons
parenta29be68a2d9b42a4bcc49c03a4ea16c9a91bf16c (diff)
downloadpdf-as-3-11cea3c04723dbb1f9df0e2c50602913654657f6.tar.gz
pdf-as-3-11cea3c04723dbb1f9df0e2c50602913654657f6.tar.bz2
pdf-as-3-11cea3c04723dbb1f9df0e2c50602913654657f6.zip
javadoc
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@710 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/api/commons')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/api/commons/DynamicSignatureProfile.java36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/api/commons/DynamicSignatureProfile.java b/src/main/java/at/gv/egiz/pdfas/api/commons/DynamicSignatureProfile.java
index fbcfaf9..b3875db 100644
--- a/src/main/java/at/gv/egiz/pdfas/api/commons/DynamicSignatureProfile.java
+++ b/src/main/java/at/gv/egiz/pdfas/api/commons/DynamicSignatureProfile.java
@@ -9,7 +9,41 @@ import at.gv.egiz.pdfas.api.sign.SignParameters;
* or {@link #setFieldValue(String, String)}.<br>
* You have to call {@link #apply()} to use the profile. The identifying name (e.g. for {@link SignParameters#setSignatureProfileId(String)}
* can be obtained via {@link #getName()}.<br>
- * Depending on the {@link DynamicSignatureLifetimeEnum} the profile can be alive and usable till you {@link #dispose()} it manually.
+ * Depending on the {@link DynamicSignatureLifetimeEnum} the profile can be alive and usable till you {@link #dispose()} it manually.
+ * <p>
+ * Sample usage:<br>
+ * <pre>
+ SignParameters sp = new SignParameters();
+ . . .
+ sp.setSignatureType(Constants.SIGNATURE_TYPE_TEXTUAL);
+ sp.setSignatureDevice(Constants.SIGNATURE_DEVICE_MOA);
+
+ // create a new dynamic profile based on SIGNATURBLOCK_DE (every property is copied) with manual lifetime
+ DynamicSignatureProfile dsp = pdfAs.createDynamicSignatureProfile("myUniqueName", "SIGNATURBLOCK_DE",
+ DynamicSignatureLifetimeEnum.MANUAL);
+
+ // set something
+ dsp.setPropertyRaw("key.SIG_META", "Statement");
+ dsp.setPropertyRaw("value.SIG_META", "respect to the man in the icecream van ${subject.EMAIL}");
+ dsp.setPropertyRaw("value.SIG_LABEL", "./images/signatur-logo_en.png");
+ dsp.setPropertyRaw("table.main.Style.halign", "right");
+
+ // mandatory: apply the profile, you have to apply again after changes (overriding your previous setting)
+ dsp.apply();
+ sp.setSignatureProfileId(dsp.getName());
+
+ // execute PDF-AS
+ pdfAs.sign(sp);
+
+ . . .
+
+ // your profile is saved and you can obtain it again anytime later:
+ dsp = pdfAs.loadDynamicSignatureProfile("myUniqueName");
+ // use it for another sign.
+ // dont forget to dispose() sometimes because it was manual lifetime
+ System.out.println(dsp.getName());
+ * </pre>
+ * </p>
*
* @author exthex
*