diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:04:22 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:04:22 +0000 |
commit | fa61b95687478f74fef239595a8e1cbc63c18ef1 (patch) | |
tree | 9c6a2c6c3577ec3e4411554dec52fe9b08c6de32 /pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas | |
parent | fb4cffd6fed59e5800f8e5803cfaf4fb45de35ec (diff) | |
download | mocca-fa61b95687478f74fef239595a8e1cbc63c18ef1.tar.gz mocca-fa61b95687478f74fef239595a8e1cbc63c18ef1.tar.bz2 mocca-fa61b95687478f74fef239595a8e1cbc63c18ef1.zip |
+ 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
Diffstat (limited to 'pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas')
2 files changed, 16 insertions, 7 deletions
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 */ |