summaryrefslogtreecommitdiff
path: root/pdf-over-signer/pdf-over-sigpdfas4/src
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2019-11-29 16:52:51 +0100
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2019-11-29 16:52:51 +0100
commit53edf26013caebbbabdb4257f18a604954b85701 (patch)
treeeaf3cda2667b0e7520de727d9bce7b4d58ec11c9 /pdf-over-signer/pdf-over-sigpdfas4/src
parentb7faf0920237f00c10c9ae02b3e0c9c1477404aa (diff)
downloadpdf-over-53edf26013caebbbabdb4257f18a604954b85701.tar.gz
pdf-over-53edf26013caebbbabdb4257f18a604954b85701.tar.bz2
pdf-over-53edf26013caebbbabdb4257f18a604954b85701.zip
adobe placeholder implementation v1
Diffstat (limited to 'pdf-over-signer/pdf-over-sigpdfas4/src')
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java32
1 files changed, 18 insertions, 14 deletions
diff --git a/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java b/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java
index e516d63f..e04022e8 100644
--- a/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java
+++ b/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java
@@ -61,7 +61,7 @@ public class PdfAs4Signer implements Signer {
String sigProfile = sign_para.getPdfAsSignatureProfileId();
String sigEmblem = (sign_para.getEmblem() == null ? null : sign_para.getEmblem().getFileName());
String sigNote = sign_para.getProperty("SIG_NOTE");
- String sigPos = sign_para.getPdfAsSignaturePosition();
+ //String sigPos = sign_para.getPdfAsSignaturePosition(); //TODO just for testing
PdfAs pdfas = PdfAs4Helper.getPdfAs();
Configuration config = pdfas.getConfiguration();
@@ -77,7 +77,7 @@ public class PdfAs4Signer implements Signer {
ByteArrayOutputStream output = new ByteArrayOutputStream();
DataSource input = new ByteArrayDataSource(parameter.getInputDocument().getByteArray());
SignParameter param = PdfAsFactory.createSignParameter(config, input, output);
- param.setSignaturePosition(sigPos);
+// param.setSignaturePosition(sigPos); //TODO just for testing
param.setSignatureProfileId(sigProfile);
String id = UUID.randomUUID().toString();
param.setTransactionId(id);
@@ -137,22 +137,26 @@ public class PdfAs4Signer implements Signer {
// result.setSignerCertificate(..);
// Set Signature position
- TablePos tp = new TablePos(param.getSignaturePosition());
- SignaturePosition sp;
- if (tp.isXauto() && tp.isYauto())
- sp = new SignaturePosition();
- else if (tp.isPauto())
- sp = new SignaturePosition(tp.getPosX(), tp.getPosY());
- else
- sp = new SignaturePosition(tp.getPosX(), tp.getPosY(), tp.getPage());
- result.setSignaturePosition(sp);
+
+ //TODO just for testing
+// TablePos tp = new TablePos(param.getSignaturePosition());
+// SignaturePosition sp;
+// if (tp.isXauto() && tp.isYauto())
+// sp = new SignaturePosition();
+// else if (tp.isPauto())
+// sp = new SignaturePosition(tp.getPosX(), tp.getPosY());
+// else
+// sp = new SignaturePosition(tp.getPosX(), tp.getPosY(), tp.getPage());
+// result.setSignaturePosition(sp);
// Set signed Document
result.setSignedDocument(new ByteArrayDocumentSource(sstate.getOutput().toByteArray()));
return result;
- } catch (PdfAsException e) {
- throw new SignatureException(e);
- } catch (PDFASError e) {
+ }
+// catch (PdfAsException e) { //TODO just for testing
+// throw new SignatureException(e);
+// }
+ catch (PDFASError e) {
throw new SignatureException(e);
}
}