From a43f3b3f266a63a505ae866a2378f01e5b508cc9 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Fri, 13 Nov 2020 12:18:13 +0100 Subject: new module pdf-over-commons added --- .gitignore | 3 ++- pdf-over-commons/pdf-over-commons.iml | 15 +++++++++++++++ pdf-over-commons/pom.xml | 15 +++++++++++++++ .../composites/SimpleConfigurationComposite.java | 2 +- .../signer/pdfas/PdfAs4SignatureParameter.java | 22 +++++++++++++--------- pom.xml | 1 + 6 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 pdf-over-commons/pdf-over-commons.iml create mode 100644 pdf-over-commons/pom.xml diff --git a/.gitignore b/.gitignore index 6787d1cc..8ec0355c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ log/ *pom.xml.releaseBackup pdf-over-build/ release.properties -*.jar-bak \ No newline at end of file +*.jar-bak +*.iml \ No newline at end of file diff --git a/pdf-over-commons/pdf-over-commons.iml b/pdf-over-commons/pdf-over-commons.iml new file mode 100644 index 00000000..c035f0b0 --- /dev/null +++ b/pdf-over-commons/pdf-over-commons.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pdf-over-commons/pom.xml b/pdf-over-commons/pom.xml new file mode 100644 index 00000000..1a68b59a --- /dev/null +++ b/pdf-over-commons/pom.xml @@ -0,0 +1,15 @@ + + + + pdf-over + at.a-sit + 4.2.4-SNAPSHOT + + 4.0.0 + + pdf-over-commons + + + \ No newline at end of file diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index 26f67da3..d65c45a5 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java @@ -767,7 +767,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { param.setSignatureProfile(this.configurationContainer.getSignatureProfile().getName()); } catch (Exception e){ - log.debug("Cannot save siganture profile" + e.getMessage()); + log.debug("Cannot save signature profile" + e.getMessage()); } } diff --git a/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java b/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java index 57f36fbd..5d286d44 100644 --- a/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java +++ b/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java @@ -34,6 +34,7 @@ import at.gv.egiz.pdfas.lib.api.Configuration; import at.gv.egiz.pdfas.lib.api.PdfAs; import at.gv.egiz.pdfas.lib.api.PdfAsFactory; import at.gv.egiz.pdfas.lib.api.sign.SignParameter; +import at.asit.pdfover.gui.Constants; /** * Implementation of SignatureParameter for PDF-AS 4 Library @@ -49,7 +50,7 @@ public class PdfAs4SignatureParameter extends SignatureParameter { private static final String PROFILE_ID_NOTE = "_NOTE"; /** The profile ID extension for PDF/A compatibility */ private static final String PROFILE_ID_PDFA = "_PDFA"; - + /** * Visibility of signature block */ @@ -58,7 +59,7 @@ public class PdfAs4SignatureParameter extends SignatureParameter { private HashMap genericProperties = new HashMap(); /** - * This parameters are defining the signature block size + * This parameters are defining the signature block size */ private int sig_w = 229; private int sig_h = 77; @@ -131,7 +132,7 @@ public class PdfAs4SignatureParameter extends SignatureParameter { /** * Gets the Signature Position String for PDF-AS - * + * * @return Signature Position String */ public String getPdfAsSignaturePosition() { @@ -168,14 +169,16 @@ public class PdfAs4SignatureParameter extends SignatureParameter { //Add Signature Param here// String profileId; - - - + + + if (!PROFILE_VISIBILITY || this.profile.equals("Unsichtbar")) { - profileId ="INVISIBLE"; + //TODO set base profile id using the this.profile + //TODO verifiy + profileId = "INVISIBLE"; } else { - profileId = PROFILE_ID_BASE; + profileId = Constants.PROFILE.getProfile(this.profile).name();//PROFILE_ID_BASE; profileId += (lang != null && lang.equals("en")) ? PROFILE_ID_LANG_EN : PROFILE_ID_LANG_DE; } @@ -187,7 +190,8 @@ public class PdfAs4SignatureParameter extends SignatureParameter { if (usePdfACompat) profileId += PROFILE_ID_PDFA; - log.debug("Profile ID: {0}", profileId); + log.debug("Profile ID: {}", profileId); + System.out.println(profileId); return profileId; } diff --git a/pom.xml b/pom.xml index 822e6ade..cc7914c8 100644 --- a/pom.xml +++ b/pom.xml @@ -85,6 +85,7 @@ pdf-over-gui pdf-over-signator pdf-over-signer + pdf-over-commons -- cgit v1.2.3