aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
authorThomas <>2023-06-27 07:05:44 +0200
committerThomas <>2023-06-27 07:05:44 +0200
commit1e580545ff0dd4c15ce05045ab1a9573dec6f9d3 (patch)
tree221157ed082d4cbf3c894aa476f550e06875923e /pdf-as-pdfbox-2/src/main/java/at/gv/egiz
parent1a46583236b58a77b11abc91681f697c4cb7e46e (diff)
downloadpdf-as-4-1e580545ff0dd4c15ce05045ab1a9573dec6f9d3.tar.gz
pdf-as-4-1e580545ff0dd4c15ce05045ab1a9573dec6f9d3.tar.bz2
pdf-as-4-1e580545ff0dd4c15ce05045ab1a9573dec6f9d3.zip
feat(placeholder): add configuration value to disable profile over-write by placehoder information
Diffstat (limited to 'pdf-as-pdfbox-2/src/main/java/at/gv/egiz')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
index 575fbc47..ee0cc4b0 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
@@ -155,7 +155,7 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
signature.setSignDate(Calendar.getInstance());
log.debug("Signing @ " + signature.getSignDate().getTime().toString());
- // extract next QR-code placeholder, if exists
+ // extract next QR-code placeholder, if exists
SignaturePlaceholderData nextPlaceholderData = PlaceholderFilter.checkPlaceholderSignatureLocation(
pdfObject.getStatus(), pdfObject.getStatus().getSettings(),
pdfObject.getStatus().getSignParamter().getPlaceHolderId());
@@ -164,14 +164,16 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
log.info("Placeholder data found.");
signature.setLocation(nextPlaceholderData.getPlaceholderName());
-
- // TODO: only over-write if requested
- if (nextPlaceholderData.getProfile() != null) {
- log.debug("Placeholder Profile set to: {}", nextPlaceholderData.getProfile());
- requestedSignature.setSignatureProfileID(nextPlaceholderData.getProfile());
+ if (nextPlaceholderData.getProfile() != null) {
+ if ( pdfObject.getStatus().getSettings().isValue(IConfigurationConstants.PLACEHOLDER_PROFILE_OVERWRITE, true)) {
+ log.debug("Placeholder Profile set to: {}", nextPlaceholderData.getProfile());
+ requestedSignature.setSignatureProfileID(nextPlaceholderData.getProfile());
- }
- }
+ } else {
+ log.debug("Placeholder profile over-write is disabled. Using profile from request ... ");
+
+ }
+ }
final SignatureProfileSettings signatureProfileSettings =