From 4fbb400c4b608e442be022929910ea26dd7e74a4 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 26 Aug 2014 16:06:22 +0200 Subject: Affine Transformation matrix type change --- .../lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java | 7 +++++-- .../lib/impl/stamping/pdfbox/PDFAsVisualSignatureDesigner.java | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java index 3d89d49f..e6ebfe04 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java @@ -706,12 +706,15 @@ public class PDFAsVisualSignatureBuilder extends PDVisibleSigBuilder { String holderFormComment = "q " + m00 + " " + m10 + " " + m01 + " " + m11 + " " + m02 + " " + m12 + " cm /" + innerFormName + " Do Q \n"; + + logger.debug("Holder Form Stream: " + holderFormComment); + // String innerFormComment = "q 1 0 0 1 0 0 cm /" + imageObjectName + // " Do Q\n"; String innerFormComment = getStructure().getInnterFormStream() .getInputStreamAsString(); - // logger.debug("Inner Form Stream: " + innerFormComment); + //logger.debug("Inner Form Stream: " + innerFormComment); // appendRawCommands(getStructure().getInnterFormStream().createOutputStream(), // getStructure().getInnterFormStream().getInputStreamAsString()); @@ -811,7 +814,7 @@ public class PDFAsVisualSignatureBuilder extends PDVisibleSigBuilder { logger.debug("rectangle of signature has been created"); } - public void createAffineTransform(byte[] params) { + public void createAffineTransform(float[] params) { AffineTransform transform = new AffineTransform(params[0], params[1], params[2], params[3], params[4], params[5]); // transform.rotate(90); diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureDesigner.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureDesigner.java index 45789491..17b02d9d 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureDesigner.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureDesigner.java @@ -50,7 +50,8 @@ public class PDFAsVisualSignatureDesigner { private InputStream imgageStream; private String signatureFieldName = "sig"; // default private float[] formaterRectangleParams = { 0, 0, 100, 50 }; // default - private byte[] AffineTransformParams = { 1, 0, 0, 1, 0, 0 }; // default + //private float[] AffineTransformParams = { 0, 1, -1, 0, 0, 0 }; // default + private float[] AffineTransformParams = { 1, 0, 0, 1, 0, 0 }; // default private float imageSizeInPercents; private PDDocument document = null; private int page = 0; @@ -326,7 +327,7 @@ public class PDFAsVisualSignatureDesigner { * * @return Affine Transform parameters of for PDF Matrix */ - public byte[] getAffineTransformParams() { + public float[] getAffineTransformParams() { return AffineTransformParams; } @@ -336,7 +337,7 @@ public class PDFAsVisualSignatureDesigner { * @return Visible Signature Configuration Object */ public PDFAsVisualSignatureDesigner affineTransformParams( - byte[] affineTransformParams) { + float[] affineTransformParams) { AffineTransformParams = affineTransformParams; return this; } -- cgit v1.2.3