I had a similar requirement. 
I know this is not the best approach but then I placed another field similar
to the one whose co-ordinates I needed on top of the one whose co-ordinates
i wanted to know and then parsed it using iText and got the co-ordinates
using the method getFieldPositions( ) of AcroFields.

Hope it works :-)

Bruno Lowagie (iText) wrote:
> 
> Udo Borkowski wrote:
>> Is there a way using iText to get the position of a image 
>> (x,y,width,height) in an existing PDF file?
> 
> There's no obvious way to find the location of an image
> in an existing PDF in general. You would understand why
> not if you read the PDF Reference Manual. You'd have to
> parse the page content and keep track of the state,
> especially the transformation matrix.
> 
>> Here some background: I got some PDF files that contain images ("white 
>> rectangles") that server as placeholders in the text.
> 
> That's a bad design.
> 
>> I plan read that 
>> PDF file and then "stamp" data (text or images) on top of this image 
>> using the PDFStamper, but I therefore need to know where these 
>> rectangles are located. (
> 
> Your best shot is to replace the images.
> 
>> (I cannot use acroForms elements because the tool that generates the 
>> original PDF files does not support acroForms)
> 
> Too bad, you should consider using another tool to create
> the PDFs or post process manually with another tool.
> br,
> Bruno
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Get-position-of-an-image-in-an-exisiting-PDF-File-tf4306093.html#a12316415
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to