Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB10E17849 for ; Wed, 1 Apr 2015 06:39:34 +0000 (UTC) Received: (qmail 19428 invoked by uid 500); 1 Apr 2015 06:39:34 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 19406 invoked by uid 500); 1 Apr 2015 06:39:34 -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 19391 invoked by uid 99); 1 Apr 2015 06:39:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2015 06:39:34 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [194.25.134.18] (HELO mailout04.t-online.de) (194.25.134.18) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2015 06:39:07 +0000 Received: from fwd40.aul.t-online.de (fwd40.aul.t-online.de [172.20.26.139]) by mailout04.t-online.de (Postfix) with SMTP id 22700FEEA0 for ; Wed, 1 Apr 2015 08:39:06 +0200 (CEST) Received: from [192.168.2.102] (bHdZJwZFZh3z1Ivs7ZmwWlhOtA3q9kb2KIzSvtEg7b0AYv3-wG4mVwegscaqn3CQvM@[217.231.153.153]) by fwd40.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1YdCIp-0jHqOO0; Wed, 1 Apr 2015 08:39:03 +0200 Message-ID: <551B92B2.8000707@t-online.de> Date: Wed, 01 Apr 2015 08:39:46 +0200 From: Tilman Hausherr User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: users@pdfbox.apache.org Subject: Re: PDFbox, converting between points and rendered pixels? References: <551A42EE.1050301@t-online.de> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-ID: bHdZJwZFZh3z1Ivs7ZmwWlhOtA3q9kb2KIzSvtEg7b0AYv3-wG4mVwegscaqn3CQvM X-TOI-MSGID: 78f6bf67-d1bc-46b0-a6f8-296ff6ddf26a X-Virus-Checked: Checked by ClamAV on apache.org Am 01.04.2015 um 06:43 schrieb Andrew Munn: >>> This method is working somewhat but not exactly. The drawn boxes are >>> ending up in the wrong place even though I've measured their pixel >>> position correctly in the rendered image. Is there a better way to >>> accomplish this? >> Yes, play with the CTM (current transformation matrix)... use transform() and >> set a ctm that flips... btw, flipping is multiplying with -1 then adding. >> > So to convert from pixels in a 720dpi rendered PDF to points in the API do > I need to do something like this? > > Matrix m = new Matrix(); > m.scale(0.10f, 0.10f); > cos.transform(m); > > or do I need to pass in some AffineTransform to the Matrix constructor? Both is possible. > Does this transform mean I no longer need the flip? The flip was for a different reason, which you explained in a previous post. What I mean is that it is easier to use a transform, than to do calculations yourself. Tilman > > Thanks! > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > For additional commands, e-mail: users-help@pdfbox.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org