diff options
Diffstat (limited to 'pdf-as-lib/src/main/java/demo')
3 files changed, 16 insertions, 1 deletions
diff --git a/pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java b/pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java index 06e454e..04d6402 100644 --- a/pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java +++ b/pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java @@ -61,6 +61,11 @@ public class SignatureCreationDemo { }
File configdir = new File("./work");
+ // look for work folder in current directory
+ if (!configdir.exists()) {
+ // otherwise look in parent directory
+ configdir = new File("../work");
+ }
File unsignedFile = new File(args[0]);
File signedFile = new File(args[0] + "_signed.pdf");
@@ -79,7 +84,7 @@ public class SignatureCreationDemo { SignParameters signParameters = new SignParameters();
signParameters.setDocument(dataSource);
signParameters.setOutput(dataSink);
- signParameters.setSignatureDevice(Constants.SIGNATURE_DEVICE_MOA); // Constants.SIGNATURE_DEVICE_BKU
+ signParameters.setSignatureDevice(Constants.SIGNATURE_DEVICE_BKU); // Constants.SIGNATURE_DEVICE_BKU
signParameters.setSignaturePositioning(new SignaturePositioning("x:100;y:200;w:500;p:1;f:80"));
signParameters.setCheckForPlaceholder(true);
// standard signature
diff --git a/pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java b/pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java index a065854..5816946 100644 --- a/pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java +++ b/pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java @@ -63,6 +63,11 @@ public class SignatureCreationWithDynamicProfilesDemo { }
File configdir = new File("./work");
+ // look for work folder in current directory
+ if (!configdir.exists()) {
+ // otherwise look in parent directory
+ configdir = new File("../work");
+ }
File unsignedFile = new File(args[0]);
File signedFile = new File(args[0] + "_signed.pdf");
diff --git a/pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java b/pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java index 878ff08..0ba95ff 100644 --- a/pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java +++ b/pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java @@ -69,6 +69,11 @@ public class SignatureVerificationDemo { }
File configdir = new File("./work");
+ // look for work folder in current directory
+ if (!configdir.exists()) {
+ // otherwise look in parent directory
+ configdir = new File("../work");
+ }
File signedFile = new File(args[0]);
AnalyzeResult analyzeResult = null;
|