pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Image Rotation In PDFBox 2
Date Tue, 22 Sep 2015 18:28:32 GMT
Just call transform() with a Matrix that does your rotation before 
drawing - because that is what the deprecated method does. Note that the 
rotation is done around the lower left axis, so you have to do a 
translation too.

Matrix can be created from an AffineTransform.

Tilman

Am 22.09.2015 um 20:22 schrieb Evan Williams:
> I know I am being super, super dumb here, but, given the deprecation
> of the *drawXObject(PDXObject
> <https://pdfbox.apache.org/docs/2.0.0-SNAPSHOT/javadocs/org/apache/pdfbox/pdmodel/graphics/PDXObject.html>
> xobject, AffineTransform
> <http://download.oracle.com/javase/1.6.0/docs/api/java/awt/geom/AffineTransform.html?is-external=true>
> transform)*method
> of *PDPageContentStream*, how does one add an image with rotation to the
> page
>
> I know I could just read the image into a buffered image, rotate it, and
> create an input stream from that, but one would think there is a better way.
>
> Is there a better way
>
> Thanks.


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


Mime
View raw message