From 11cea3c04723dbb1f9df0e2c50602913654657f6 Mon Sep 17 00:00:00 2001
From: pdanner
+ * Sample usage:null if not found.
+ * @see DynamicSignatureProfile
*/
public DynamicSignatureProfile loadDynamicSignatureProfile(String profileName);
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)}.
* 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()}.
- * 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.
+ *
+ *
+ 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());
+ *
+ *
+ * Sample usage: + *
+ SignParameters sp = new SignParameters();
+ . . .
+
+ sp.setSignatureProfileId("SIGNATURBLOCK_DE");
+
+ // expressions do not work on binary signature fields without phlength setting!!
+ sp.setProfileOverrideValue("SIG_META", "It's nice to be important, but it is more important to be nice ${subject.L}");;
+ sp.setProfileOverrideValue("SIG_LABEL", "./images/signatur-logo_en.png");
+
+ // execute sign using the overrides
+ pdfAs.sign(sp);
+
+ *
* @param key the name of the setting to override e.g. "SIG_META"
* @param value The new value
*/
--
cgit v1.2.3