From fa61b95687478f74fef239595a8e1cbc63c18ef1 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:04:22 +0000 Subject: + changed to small signature block + fixed placeholder dimension to paper coordinates of placeholder git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@112 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../at/asit/pdfover/signer/pdfas/PDFASSigner.java | 2 +- .../signer/pdfas/PdfAsSignatureParameter.java | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'pdf-over-signer') diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java index 516a54ad..81302bf2 100644 --- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java +++ b/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/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 3879c434..39c64371 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 @@ -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