summaryrefslogtreecommitdiff
path: root/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:24:36 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:24:36 +0000
commita387fd9a39d3556b5e49e407ea5dd48ea9b33ef7 (patch)
treecdc4cf5d921b20f92be3438af34258a9270fbf61 /pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover
parentf6ebbe07cd9ddd9f379b9ebc173e82ed2b755cb0 (diff)
downloadmocca-a387fd9a39d3556b5e49e407ea5dd48ea9b33ef7.tar.gz
mocca-a387fd9a39d3556b5e49e407ea5dd48ea9b33ef7.tar.bz2
mocca-a387fd9a39d3556b5e49e407ea5dd48ea9b33ef7.zip
+ fixed BKU Selection buttons
+ fixed pdf-as placeholder git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@305 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover')
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java53
1 files changed, 50 insertions, 3 deletions
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 7e1c486e..8ec31d63 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
@@ -137,7 +137,8 @@ public class PdfAsSignatureParameter extends SignatureParameter {
@Override
public SignatureDimension getPlaceholderDimension() {
// return new SignatureDimension(487, 206);
- return new SignatureDimension(getWidth(), getHeight());
+ return new SignatureDimension(276, 126);
+ //return new SignatureDimension(getWidth(), getHeight());
}
private static int getWidth() {
@@ -187,6 +188,52 @@ public class PdfAsSignatureParameter extends SignatureParameter {
public Image getPlaceholder() {
try {
+ Image logo = null;
+ try {
+ if (this.getEmblem() != null
+ && this.getEmblem().getFileName() != null
+ && new File(this.getEmblem().getFileName())
+ .exists()) {
+ logo = ImageIO.read(new File(this.getEmblem()
+ .getFileName()));
+
+ }
+ }
+ catch(Exception e) {
+ log.error("Failed to get emblem ...", e);
+ }
+
+ Image img = null;
+ String lang = getSignatureLanguage();
+ if (lang != null && lang.equals("en")) {
+ img = ImageIO.read(PdfAsSignatureParameter.class
+ .getResourceAsStream("/img/sign_prev_en.png"));
+
+ if(logo != null) {
+ logo = logo.getScaledInstance(141, 140,
+ Image.SCALE_SMOOTH);
+ img.getGraphics().drawImage(logo, 6, 115, null);
+ }
+
+ } else {
+ img = ImageIO.read(PdfAsSignatureParameter.class
+ .getResourceAsStream("/img/sign_prev_de.png"));
+
+ if(logo != null) {
+ logo = logo.getScaledInstance(141, 140,
+ Image.SCALE_SMOOTH);
+ img.getGraphics().drawImage(logo, 6, 115, null);
+ }
+ }
+ return img;
+ } catch (IOException e) {
+ return new BufferedImage(getPlaceholderDimension().getWidth(),
+ getPlaceholderDimension().getHeight(),
+ BufferedImage.TYPE_INT_RGB);
+ }
+
+ /*
+ try {
PDFASHelper.getPdfAs();
@@ -238,7 +285,7 @@ public class PdfAsSignatureParameter extends SignatureParameter {
getPlaceholderDimension().getHeight(),
BufferedImage.TYPE_INT_RGB);
}
- }
+ }*/
}
private Table getSignatureTable() throws SignatureException, SignatureTypesException {
@@ -461,7 +508,7 @@ public class PdfAsSignatureParameter extends SignatureParameter {
float[] sizes = new float[rows.size()];
Style style = parentstyle;
if (table.getStyle() != null) {
- style = table.getStyle();
+ style = table.getStyle();
}
Font font = PdfAsSignatureParameter.getFont(style);
g.setFont(font);