aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2013-01-28 13:57:03 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2013-01-28 13:57:03 +0000
commit5c5010f818b32b43f2c0c799ef062ef12bff66ca (patch)
tree298ff1a94f0740e446b2b1f3df1b1c5b562f4fa0 /pdf-as-lib/src/main/java
parentf9850d02d8559b7e7f3555d0e2c7cfe746257958 (diff)
downloadpdf-as-3-5c5010f818b32b43f2c0c799ef062ef12bff66ca.tar.gz
pdf-as-3-5c5010f818b32b43f2c0c799ef062ef12bff66ca.tar.bz2
pdf-as-3-5c5010f818b32b43f2c0c799ef062ef12bff66ca.zip
Maven build scripts enhanced.
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/pdf-as/trunk@928 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'pdf-as-lib/src/main/java')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/test/JarExtractTest.java51
-rw-r--r--pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java7
-rw-r--r--pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java5
-rw-r--r--pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java5
4 files changed, 16 insertions, 52 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/test/JarExtractTest.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/test/JarExtractTest.java
deleted file mode 100644
index d804b64..0000000
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/test/JarExtractTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.test;
-
-import at.gv.egiz.pdfas.api.commons.Constants;
-import at.gv.egiz.pdfas.utils.ConfigUtils;
-
-public final class JarExtractTest {
-
- private JarExtractTest() {
- }
-
- public static void main(String[] args) {
- try {
-
- String sysProp = System.getProperty(Constants.CONFIG_DIR_SYSTEM_PROPERTY);
- System.out.println("System property \"" + Constants.CONFIG_DIR_SYSTEM_PROPERTY + "\" = " + (sysProp != null ? ("\"" + sysProp + "\"") : null));
-
- String deployedTo = ConfigUtils.deployDefaultConfiguration();
- if (deployedTo != null) {
- System.out.println("Configuration successfully deployed to \"" + deployedTo + "\".");
- } else {
- System.out.println("Configuration was NOT deployed. Maybe a configuration already exists.");
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
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;