From users-return-11269-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Mon Oct 29 09:45:17 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 73BE4180627 for ; Mon, 29 Oct 2018 09:45:16 +0100 (CET) Received: (qmail 49064 invoked by uid 500); 29 Oct 2018 08:45:15 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 49047 invoked by uid 99); 29 Oct 2018 08:45:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Oct 2018 08:45:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 02510C0090 for ; Mon, 29 Oct 2018 08:45:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.889 X-Spam-Level: * X-Spam-Status: No, score=1.889 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id x3RnwzBh7k3I for ; Mon, 29 Oct 2018 08:45:11 +0000 (UTC) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 616755F405 for ; Mon, 29 Oct 2018 08:45:10 +0000 (UTC) Received: by mail-ed1-f43.google.com with SMTP id w19-v6so6519373eds.1 for ; Mon, 29 Oct 2018 01:45:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=RJJJfN7jlfdMoTblTt+V7xBj5+/J7U15wenuJxPYJJ0=; b=o5oJe5/o30gVHEo775CZl4i/V21sDCG9CuHelM89UJ/WIHeBZFoAVoHsiJy58n/k1N EKNUeoYr42ZjrlOGOxhjnD7mJXJeZHNe694HZpVl39bRfaVq4VxGubl2h6G5SLxcCGDs bOeLYl87ZKto4ieDdP9x1Q8utxD4kggeNoGPHHhyO3TcRIiNVyUXW5tSU+7O0S5Rqihb xGafStlcTvPpOzEQ4sXl1yHDYzKw8oO6JbNjr1nTWCbovbmd3ihjDX4lKMY9MMBJEPXT Mddm1GQ+957JZ14NMvwom4BIyTK8797xcv1jcG7AfPyBPaU2+3LCHps17YcsH5LFZZ4l W06g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=RJJJfN7jlfdMoTblTt+V7xBj5+/J7U15wenuJxPYJJ0=; b=IgCeO9jRkEKUITAnj7HHw8ltzENynjkEoYslMCItDicZd9dQ1DFBL8CYsllArYkxKO /vEu9Tb8vlXaVvKOWLmMiJdUU20Hi9+iFJgQ/5Qo+wTXKQaG6q499mOMYQeD1Gz8u/22 WEyP5ou9K95QZdwsNj8sfVsy25s3Rv6gXZ5vO46bZtATtGV/jUN7rsB1V5G206bCdRAM tKSND0ghUpCL3dlx/OfzTzjohcg4igl+k+MLldXyQs4krBQBRTMiBmZDl3O208fFPZSO sqjgEi8xf9ZtRpt5iQ+MsUjXLLH7ir1pWN46Jy9dSVoAgu65EiJs8LMF7dL4Hq2DIrLy mo8g== X-Gm-Message-State: AGRZ1gLzBcnytSVocekV102ZDZWApt0Coj+Xjp6G2+KdkZB02l2yhxbP Wd6XPeGqm6qbds5xCg0DBH1zodYt/8o= X-Google-Smtp-Source: AJdET5coTO4A+IdYb/GRMbssf+mdolWNeAg+c/YxMTfDSIw506lcfcarDPNKkHkn6B8X4TzEthI2eg== X-Received: by 2002:a50:b7b7:: with SMTP id h52-v6mr12965360ede.17.1540802708921; Mon, 29 Oct 2018 01:45:08 -0700 (PDT) Received: from patricks-mbp.fritz.box ([80.254.190.227]) by smtp.gmail.com with ESMTPSA id a40-v6sm6982540edd.61.2018.10.29.01.45.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 01:45:07 -0700 (PDT) From: Patrick Herber Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_53661468-41DA-4B67-A949-3A6034425EA2" X-Priority: 3 Subject: Re: Re: Adjust signature field for rotated pages Date: Mon, 29 Oct 2018 09:45:06 +0100 References: <84E60C0C-C22C-488B-A918-18DEDAF9786C@gmail.com> <86441455-CCBA-414C-B190-C7D11A65FB7E@gmail.com> <1af009d3-ee10-5525-e451-5b0d89ddbb9d@t-online.de> <6bc2f30c-98b4-0b3f-5596-2cad7a0ebb30@t-online.de> <992F353B-9F58-430A-8824-648BD344916B@gmail.com> <2e6da45f-71b9-7a02-71a4-98d094861934@t-online.de> <666DC909-7D94-465F-8ADB-414277CB0059@gmail.com> <1540800587686.8176394.716dd5eff0c124aca5b09929c7d0b76479a9facd@spica.telekom.de> To: users@pdfbox.apache.org In-Reply-To: <1540800587686.8176394.716dd5eff0c124aca5b09929c7d0b76479a9facd@spica.telekom.de> Message-Id: <64752FD2-68A9-41ED-842C-7D5AD6F78EF1@gmail.com> X-Mailer: Apple Mail (2.3445.9.1) --Apple-Mail=_53661468-41DA-4B67-A949-3A6034425EA2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi, I uploaded the file on my Google Drive and I was about to share it, when = I saw in the preview that the dimensions of the image were correctly = displayed: so I opened the file locally with Acrobat Reader and also = there the image was correct. It seems therefore a problem with the MacOS = Preview application that I used before during my tests=E2=80=A6 Sorry than to have bother you for that! Thanks again and best regards Patrick > On 29 Oct 2018, at 09:09, Tilman Hausherr = wrote: >=20 > Hi, >=20 > please share the signed 90=C2=B0 file (upload to a sharehoster, = attachments are=20 > usually deleted). I'll have a look at it with PDFDebugger to see what = is=20 > different. >=20 > Tilman >=20 >=20 >=20 > --- Original-Nachricht --- > Von: Patrick Herber > Betreff: Re: Adjust signature field for rotated pages > Datum: 29.10.2018, 8:02 Uhr > An: users@pdfbox.apache.org >=20 >=20 >=20 >=20 >=20 > Dear Tilman >=20 > Thanks a lot for your reply I=E2=80=99ve tried with the =E2=80=9Clatest"= snapshot WAR files=20 > of version 2.0.13 (2.0.13-20181024.204010-80), 2.1.0 and 3=20 > (3.0.0-20181026.180346-919) using the trunk version of the=20 > CreateVisibleSignature example class, changing only the line you = mentioned=20 > inside the setVisibleSignDesigner method but unfortunately with all = these=20 > versions I get the same result as in my previous screenshot: the width = of=20 > the image is not correct. >=20 > After the adjustForRotation() call the value of affineTransform is as = you=20 > wrote: >=20 > AffineTransform[[0.0, -2.88043475151062, 265.0], [0.347169816493988, = 0.0,=20 > 0.0]] >=20 > What could be then the difference? >=20 > Thanks again and best regards >=20 > Patrick Herber >=20 >=20 >=20 >> On 27 Oct 2018, at 10:23, Tilman Hausherr > > wrote: >>=20 >> Sorry about that... I signed the three files: >>=20 >>=20 > = https://drive.google.com/drive/folders/1D8qlk-_qF4cUz2iXemmGZbYIow1uSKs5?u= sp=3Dsharing = > = >=20 > < > = https://drive.google.com/drive/folders/1D8qlk-_qF4cUz2iXemmGZbYIow1uSKs5?u= sp=3Dsharing = > > = >>=20 > ; >>=20 >> How did you sign them? By getting the code from a snapshot or by=20 > extending the class? >>=20 >> I used the CreateVisibleSignature example with the modification you=20= > mentioned: >>=20 >> public void setVisibleSignDesigner(String filename, int x, int y, int=20= > zoomPercent, >> InputStream imageStream, int page) >> throws IOException >> { >> visibleSignDesigner =3D new PDVisibleSignDesigner(filename, = imageStream,=20 > page); >>=20 > = visibleSignDesigner.xAxis(x).yAxis(y).height(92).width(265).adjustForRotat= ion(); >> } >>=20 >> I tested with the trunk, but 2.0 should be identical in that aspect. >>=20 >> If you extended the class and used the code I posted, here's the=20 > affinetransform after adjustforrotation(): >>=20 >> 90=C2=B0: >> AffineTransform[[0.0, -2.88043475151062, 265.0], [0.347169816493988, = 0.0,=20 > 0.0]] >>=20 >> 180=C2=B0: >> AffineTransform[[-1.0, 0.0, 265.0], [0.0, -1.0, 92.0]] >>=20 >> 270=C2=B0 >> AffineTransform[[0.0, 2.88043475151062, 0.0], [-0.347169816493988, = 0.0,=20 > 92.0]] >>=20 >> Tilman >>=20 >> Am 26.10.2018 um 22:58 schrieb Patrick Herber: >>> Thanks a lot for this really quick fix! >>>=20 >>> I=E2=80=99ve tested the correction but I fear there is still a small = issue. The=20 > signature field is now correctly positioned inside the page for the 4=20= > rotations, but in case of 90 and 270 degrees the signature images does = not=20 > correctly fit the field. >>>=20 >>> 90 degrees: signature image dimensions are not correct (height OK = but=20 > width to small): >>>=20 >>> <90degrees.png> >> ; >>>=20 >>> 180 degrees: signature image dimensions are correct: >>>=20 >>>=20 >>> <180degrees.png> >> ; >>>=20 >>>=20 >>> Best regards and again thanks for the support! >>>=20 >>> Patrick >>>=20 >>>=20 >>>> On 24 Oct 2018, at 21:57, Tilman Hausherr > > = > > >> = wrote: >>>>=20 >>>> Done in >>>>=20 >>>> https://issues.apache.org/jira/browse/PDFBOX-4359 = > > < > https://issues.apache.org/jira/browse/PDFBOX-4359 = > > > ; >>>>=20 >>>> There will be a snapshot in a few hours, hopfully (build server=20 > unstable) >>>>=20 >>>> Tilman >>>>=20 >>>>=20 >>>>=20 >>>> Am 24.10.2018 um 19:20 schrieb Tilman Hausherr: >>>>> Please extend the PDVisibleSignDesigner class and implement this=20= > method. I'll commit this later (don't have much time right now). >>>>>=20 >>>>>=20 >>>>> public PDVisibleSignDesigner adjustForRotation() >>>>> { >>>>> switch (rotation) >>>>> { >>>>> case 90: >>>>> // https://stackoverflow.com/a/34359956/535646 = > > < > https://stackoverflow.com/a/34359956/535646 = > > > ; >>>>> float temp =3D yAxis; >>>>> yAxis =3D pageHeight - xAxis - imageWidth; >>>>> xAxis =3D temp; >>>>>=20 >>>>> affineTransform =3D new AffineTransform( >>>>> 0, imageHeight / imageWidth, -imageWidth / imageHeight, 0, = imageWidth,=20 > 0); >>>>>=20 >>>>> temp =3D imageHeight; >>>>> imageHeight =3D imageWidth; >>>>> imageWidth =3D temp; >>>>> break; >>>>>=20 >>>>> case 180: >>>>> float newX =3D pageWidth - xAxis - imageWidth; >>>>> float newY =3D pageHeight - yAxis - imageHeight; >>>>> xAxis =3D newX; >>>>> yAxis =3D newY; >>>>>=20 >>>>> affineTransform =3D new AffineTransform(-1, 0, 0, -1, imageWidth,=20= > imageHeight); >>>>> break; >>>>>=20 >>>>> case 270: >>>>> temp =3D xAxis; >>>>> xAxis =3D pageWidth - yAxis - imageHeight; >>>>> yAxis =3D temp; >>>>>=20 >>>>> affineTransform =3D new AffineTransform( >>>>> 0, -imageHeight / imageWidth, imageWidth / imageHeight, 0, 0,=20 > imageHeight); >>>>>=20 >>>>> temp =3D imageHeight; >>>>> imageHeight =3D imageWidth; >>>>> imageWidth =3D temp; >>>>> break; >>>>>=20 >>>>> case 0: >>>>> default: >>>>> break; >>>>> } >>>>> return this; >>>>> } >>>>>=20 >>>>>=20 >>>>>=20 >>>>>=20 >>>>> = --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > > users-unsubscribe@pdfbox.apache.org = > > > >>>>> For additional commands, e-mail: users-help@pdfbox.apache.org = > > = > > > >>>>>=20 >>>>=20 >>>>=20 >>>> = --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org = > > users-unsubscribe@pdfbox.apache.org = > > > >>>> For additional commands, e-mail: users-help@pdfbox.apache.org = > > = > > > --Apple-Mail=_53661468-41DA-4B67-A949-3A6034425EA2--