Finding page position of an image
- From: bruno <bruno (at) lowagie.com>
- Date: Tue, 16 May 2006 11:26:34 +0200
Petter Nyström wrote:
How can I get the co-ordinates of a PdfObject / PdfStream on a page?
I use iText for doing stuff with images in PDF documents. In iText I
work with the images as PdfStreams. Looking through the API
documentation, I see that the Image class holds data for the absolute
position of an image. My question is how can I get that for a
PdfStream? I suppose I somehow need to get in touch with the content
stream in order to find out the position of a PdfObject, but can't
find any hints in the docs.
Images (iText) are added as Image XObjects (PDF).
In the content stream of the page, you will have something like this:
q 80 0 0 32 36 780 cm /Img0 Do Q
The numbers 80 0 0 32 36 780 are the values of the Current
Transformation Matrix.
In this case, an image of 80 by 32 user units is positioned at x = 36
and y = 780.
That's the simple explanation.
In reality, it can be very difficult to find the exact location of the image
(and you will need to read the PDF Reference to understand any explanation).
br,
Bruno
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions