From 96a1a5c9d04238c63247794ad9c76e5a2001b8d0 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 18:58:27 +0000 Subject: Moved Mobile BKU URL to configuration file Extracted localizable Strings git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@61 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../signer/pdfas/PdfAsSignatureParameter.java | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'pdf-over-signer') diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java index 5b15543e..fa1572e9 100644 --- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java +++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java @@ -17,12 +17,13 @@ package at.asit.pdfover.signer.pdfas; //Imports import java.util.HashMap; -import java.util.Properties; import at.asit.pdfover.signator.SignatureDimension; import at.asit.pdfover.signator.SignatureParameter; +import at.asit.pdfover.signator.SignaturePosition; import at.gv.egiz.pdfas.api.io.DataSource; import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning; +import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException; /** * Implementation of SignatureParameter specific for PDF - AS Library @@ -33,17 +34,27 @@ public class PdfAsSignatureParameter extends SignatureParameter { @Override public SignatureDimension getPlaceholderDimension() { - // TODO Auto-generated method stub - return null; + return new SignatureDimension(487, 206); } /** * Gets the PDFAS Positioning * @return SignaturePositioning + * @throws PDFDocumentException */ - public SignaturePositioning getPDFASPositioning() { - // TODO: implement Signature creation - return new SignaturePositioning(); + public SignaturePositioning getPDFASPositioning() throws PDFDocumentException { + SignaturePosition position = this.getSignaturePosition(); + position.useAutoPositioning(); + + SignaturePositioning positioning = null; + if(!position.useAutoPositioning()) { + positioning = new SignaturePositioning(String.format("p:%d;x:%f;y:%f", + position.getPage(), position.getX(), position.getY())); + } else { + positioning = new SignaturePositioning(); + } + + return positioning; } /** -- cgit v1.2.3