diff options
author | tkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459> | 2012-10-31 16:36:45 +0000 |
---|---|---|
committer | tkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459> | 2012-10-31 16:36:45 +0000 |
commit | 81ca4e419779d6a71da9d9cbc3fa2dbc0d0c1912 (patch) | |
tree | a0964935d4aae0ed7505c53a5d756b2a12098c6f /trunk/pdf-over-signer/pdf-over-sigpdfas/src | |
parent | 9f13a8435a68fec9d7da2a55cd4591a14f762c82 (diff) | |
download | pdf-over-81ca4e419779d6a71da9d9cbc3fa2dbc0d0c1912.tar.gz pdf-over-81ca4e419779d6a71da9d9cbc3fa2dbc0d0c1912.tar.bz2 pdf-over-81ca4e419779d6a71da9d9cbc3fa2dbc0d0c1912.zip |
upscale placeholder image
git-svn-id: https://svn.iaik.tugraz.at/svn/egiz/prj/current/12PDF-OVER-4.0@12719 3a0b52a2-8410-0410-bc02-ff6273a87459
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.java | 25 |
1 files changed, 14 insertions, 11 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 0af728a1..3ca1ace1 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 @@ -55,6 +55,8 @@ public class PdfAsSignatureParameter extends SignatureParameter { static final Logger log = LoggerFactory .getLogger(PdfAsSignatureParameter.class); + private static final int PLACEHOLDER_SCALE = 4; + private HashMap<String, String> genericProperties = new HashMap<String, String>(); /** @@ -132,8 +134,8 @@ public class PdfAsSignatureParameter extends SignatureParameter { sign_obj.fillValues(' ', true, false); sign_obj.setKZ(BinarySignator_1_1_0.MY_ID); - float width = getPlaceholderDimension().getWidth(); - float height = getPlaceholderDimension().getHeight(); + float width = getPlaceholderDimension().getWidth() * PLACEHOLDER_SCALE; + float height = getPlaceholderDimension().getHeight() * PLACEHOLDER_SCALE; Table table = sign_obj.getAbstractTable(); @@ -202,9 +204,9 @@ public class PdfAsSignatureParameter extends SignatureParameter { if (font_arr.length != 3) { return Font.decode(def); } - return Font.decode(String.format("%s-%s-%s", font_arr[0], font_arr[2], + Font font = Font.decode(String.format("%s-%s-%s", font_arr[0], font_arr[2], font_arr[1])); - + return font.deriveFont((float) font.getSize() * PLACEHOLDER_SCALE); } /** @@ -222,8 +224,9 @@ public class PdfAsSignatureParameter extends SignatureParameter { if (font_arr.length != 3) { return Font.decode(def); } - return Font.decode(String.format("%s-%s-%s", font_arr[0], font_arr[2], + Font font = Font.decode(String.format("%s-%s-%s", font_arr[0], font_arr[2], font_arr[1])); + return font.deriveFont((float) font.getSize() * PLACEHOLDER_SCALE); } @SuppressWarnings("rawtypes") @@ -298,8 +301,8 @@ public class PdfAsSignatureParameter extends SignatureParameter { + "/" + entry.getValue().toString())); } - int imgWidth = 40; - int imgHeight = 40; + int imgWidth = 40 * PLACEHOLDER_SCALE; + int imgHeight = 40 * PLACEHOLDER_SCALE; Image img = image.getScaledInstance(imgWidth, imgHeight, Image.SCALE_SMOOTH); @@ -366,10 +369,10 @@ public class PdfAsSignatureParameter extends SignatureParameter { if (entry.getType() == 0 || entry.getType() == 1) { String fontString = style.getFont(); String[] font_arr = fontString.split(","); - int fontSize = 8; + int fontSize = 8 * PLACEHOLDER_SCALE; if (font_arr.length == 3) { - fontSize = Integer.parseInt(font_arr[1]); + fontSize = Integer.parseInt(font_arr[1]) * PLACEHOLDER_SCALE; } if (rsize < ((style.getPadding() * 2) + fontSize)) { @@ -407,10 +410,10 @@ public class PdfAsSignatureParameter extends SignatureParameter { if (entry.getType() == 0 || entry.getType() == 1) { String fontString = style.getFont(); String[] font_arr = fontString.split(","); - int fontSize = 8; + int fontSize = 8 * PLACEHOLDER_SCALE; if (font_arr.length == 3) { - fontSize = Integer.parseInt(font_arr[1]); + fontSize = Integer.parseInt(font_arr[1]) * PLACEHOLDER_SCALE; } if (rsize < ((style.getPadding() * 2) + fontSize)) { |