From 8f2af4444822927a20dadcf902920f24e9100d5f Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 31 Oct 2012 16:36:37 +0000 Subject: + changed to small signature block + fixed placeholder dimension to paper coordinates of placeholder git-svn-id: https://svn.iaik.tugraz.at/svn/egiz/prj/current/12PDF-OVER-4.0@12698 3a0b52a2-8410-0410-bc02-ff6273a87459 --- .../at/asit/pdfover/signator/SignaturePosition.java | 2 +- .../at/asit/pdfover/signer/pdfas/PDFASSigner.java | 2 +- .../signer/pdfas/PdfAsSignatureParameter.java | 21 +++++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignaturePosition.java b/trunk/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignaturePosition.java index e56461a4..edcb263d 100644 --- a/trunk/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignaturePosition.java +++ b/trunk/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignaturePosition.java @@ -35,7 +35,7 @@ public class SignaturePosition { /** * The page value of the position */ - protected int page = 1; + protected int page = 0; /** * Whether automatic positioning is used diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java index 516a54ad..81302bf2 100644 --- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java +++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java @@ -36,7 +36,7 @@ public class PDFASSigner implements Signer { /** * The profile ID */ - protected static final String PROFILE_ID = "SIGNATURBLOCK_DE"; + protected static final String PROFILE_ID = "SIGNATURBLOCK_SMALL_DE"; /** * The template URL diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java index 3879c434..39c64371 100644 --- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java +++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java @@ -60,7 +60,7 @@ public class PdfAsSignatureParameter extends SignatureParameter { public SignatureDimension getPlaceholderDimension() { // return new SignatureDimension(487, 206); - return new SignatureDimension(976, 329); + return new SignatureDimension(262, 88); } /** @@ -76,9 +76,15 @@ public class PdfAsSignatureParameter extends SignatureParameter { SignaturePositioning positioning = null; if (!position.useAutoPositioning()) { - positioning = new SignaturePositioning(String.format( - "p:%d;x:%f;y:%f", position.getPage(), position.getX(), - position.getY())); + if (position.getPage() < 1) { + positioning = new SignaturePositioning(String.format( + "p:new;x:%f;y:%f;w:262", position.getX(), + position.getY())); + } else { + positioning = new SignaturePositioning(String.format( + "p:%d;x:%f;y:%f;w:262", position.getPage(), position.getX(), + position.getY())); + } } else { positioning = new SignaturePositioning(); } @@ -149,7 +155,7 @@ public class PdfAsSignatureParameter extends SignatureParameter { this.drawTable(0, 0, (int) width, (int) height, table, table.getStyle(), graphic, heights); - //save(image, "png"); + // save(image, "png"); return image; } catch (Exception ex) { @@ -157,13 +163,16 @@ public class PdfAsSignatureParameter extends SignatureParameter { return ImageIO.read(PdfAsSignatureParameter.class .getResourceAsStream("/img/fallbackPlaceholder.png")); } catch (IOException e) { - return new BufferedImage(getPlaceholderDimension().getWidth(), getPlaceholderDimension().getHeight(), BufferedImage.TYPE_INT_RGB); + return new BufferedImage(getPlaceholderDimension().getWidth(), + getPlaceholderDimension().getHeight(), + BufferedImage.TYPE_INT_RGB); } } } /** * used for debugging .. + * * @param image * @param ext */ -- cgit v1.2.3