aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmina Ahmetovic <emina.ahmetovic@egiz.gv.at>2020-11-02 08:38:55 +0100
committerEmina Ahmetovic <emina.ahmetovic@egiz.gv.at>2020-11-02 08:38:55 +0100
commit63e243d01fdedf84fe36287e75ae58e064d3e673 (patch)
tree2c8cb9b1933679556a126bf4efcd1728fb3a37b5
parent892c852352f48b18f2f2dadff6c223039d41aba0 (diff)
downloadpdf-as-4-63e243d01fdedf84fe36287e75ae58e064d3e673.tar.gz
pdf-as-4-63e243d01fdedf84fe36287e75ae58e064d3e673.tar.bz2
pdf-as-4-63e243d01fdedf84fe36287e75ae58e064d3e673.zip
change properties
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderWebConfiguration.java6
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java12
2 files changed, 6 insertions, 12 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderWebConfiguration.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderWebConfiguration.java
index 8c63ed02..3a78f24f 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderWebConfiguration.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderWebConfiguration.java
@@ -6,8 +6,10 @@ public class PlaceholderWebConfiguration {
protected static Properties properties = new Properties();
+ //todo properties not cleaned
public static void setValue(String key, String value)
{
+ properties.clear();
properties.setProperty(key,value);
}
public static String getValue(String key)
@@ -15,4 +17,8 @@ public class PlaceholderWebConfiguration {
return properties.getProperty(key);
}
+ public static void clear () {
+ properties.clear();
+ }
+
}
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 f2ef70f1..8f67c96b 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
@@ -153,7 +153,6 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
signature.setFilter(COSName.getPDFName(signer.getPDFFilter()));
signature.setSubFilter(COSName.getPDFName(signer.getPDFSubFilter()));
-
SignaturePlaceholderData signaturePlaceholderDataInit = PlaceholderFilter.checkPlaceholderSignatureLocation(pdfObject.getStatus(), pdfObject.getStatus().getSettings(), placeholder_id);
//gives a list of all placeholders
@@ -246,7 +245,6 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
signatureProfileSettings.setPDFAVersion(pdfaVersion);
}
-
// Is visible Signature
if (requestedSignature.isVisual()) {
logger.info("Creating visual siganture block");
@@ -314,7 +312,6 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
if(!isAdobeSigForm) {
if (positioningInstruction.isMakeNewPage()) {
-
int last = doc.getNumberOfPages() - 1;
PDDocumentCatalog root = doc.getDocumentCatalog();
PDPage lastPage = root.getPages().get(last);
@@ -327,13 +324,10 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
// handle rotated page
int targetPageNumber = positioningInstruction.getPage();
-
logger.debug("Target Page: " + targetPageNumber);
PDPage targetPage = doc.getPages().get(targetPageNumber - 1);
int rot = targetPage.getRotation();
logger.debug("Page rotation: " + rot);
- // positioningInstruction.setRotation(positioningInstruction.getRotation()
- // // + rot);
logger.debug("resulting Sign rotation: " + positioningInstruction.getRotation());
SignaturePositionImpl position = new SignaturePositionImpl();
@@ -342,7 +336,6 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
position.setPage(positioningInstruction.getPage());
position.setHeight(visualObject.getHeight());
position.setWidth(visualObject.getWidth());
-
requestedSignature.setSignaturePosition(position);
}
@@ -389,7 +382,6 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
InputStream colorProfile = null;
//colorProfile = this.getClass().getResourceAsStream("/icm/sRGB.icm");
colorProfile = this.getClass().getResourceAsStream("/icm/sRGB Color Space Profile.icm");
-
//Set output intents for PDF/A conformity//
try {
PDOutputIntent intent = new PDOutputIntent(doc, colorProfile);
@@ -412,7 +404,6 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
IOUtils.closeQuietly(colorProfile);
}
}
-
options.setPage(positioningInstruction.getPage()-1);
options.setVisualSignature(properties.getVisibleSignature());
}
@@ -424,8 +415,6 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
if (sigFieldName == null) {
sigFieldName = "PDF-AS Signatur";
}
-
-
int count = PdfBoxUtils.countSignatures(doc, sigFieldName);
sigFieldName = sigFieldName + count;
@@ -625,7 +614,6 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
synchronized (doc) {
doc.saveIncremental(bos);
byte[] outputDocument = bos.toByteArray();
- doc.save(bos);
pdfObject.setSignedDocument(outputDocument);
}
/* Check if resulting pdf is PDF-A conform */