pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Munn <and...@nmedia.net>
Subject Re: PDFbox, converting between points and rendered pixels?
Date Wed, 01 Apr 2015 04:43:12 GMT
> > 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?  
Does this transform mean I no longer need the flip?

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message