summaryrefslogtreecommitdiff
path: root/trunk/pdf-over-signer/pdf-over-sigpdfas/src
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2012-11-14 09:56:45 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2012-11-14 10:25:19 +0100
commitec8fc4bc5fccdda812ec9fbab24b154f6e687dbf (patch)
tree9d623c61c24324461e386f50ba543ea9e76ab597 /trunk/pdf-over-signer/pdf-over-sigpdfas/src
parent47e1b81fcc7ae3d5604db7979cb1db057e75c298 (diff)
downloadpdf-over-ec8fc4bc5fccdda812ec9fbab24b154f6e687dbf.tar.gz
pdf-over-ec8fc4bc5fccdda812ec9fbab24b154f6e687dbf.tar.bz2
pdf-over-ec8fc4bc5fccdda812ec9fbab24b154f6e687dbf.zip
+ fixed BKU Selection buttons
+ fixed pdf-as placeholder
Diffstat (limited to 'trunk/pdf-over-signer/pdf-over-sigpdfas/src')
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java53
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/resources/img/sign_prev_de.pngbin0 -> 13580 bytes
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/resources/img/sign_prev_en.pngbin0 -> 16968 bytes
3 files changed, 50 insertions, 3 deletions
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 7e1c486e..8ec31d63 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
@@ -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);
diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/resources/img/sign_prev_de.png b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/resources/img/sign_prev_de.png
new file mode 100644
index 00000000..c8ca09f4
--- /dev/null
+++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/resources/img/sign_prev_de.png
Binary files differ
diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/resources/img/sign_prev_en.png b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/resources/img/sign_prev_en.png
new file mode 100644
index 00000000..aa450fcc
--- /dev/null
+++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/resources/img/sign_prev_en.png
Binary files differ