By Date: <-- -->
By Thread: <-- -->

Modifying the images in PDF



Hi,

On 31/10/06, aqeel saifi <aqeel_saifi (at) yahoo.co.in> wrote:
>
> Hi All,
> As far as I have digged, we can not directly modify the images in pdf file
> with iText. Although we can get the image data from the XObject. right?
> Actually I intend to create a new pdf from an existing one with some of the
> contained images changed/repalced with some other.
> As we can't replace image directly with iText, I have two options in mind to
> achieve this.
> a. Is it possible that I render the changed image (different image) on the
> existing image position to give the effect that image is actually changed.

I'm no iText guru, but to achieve that I think you could use the
PdfStamper. See the docs for more information about it.

> b. Other could be, if possible, I create new pdf from the existing one and
> all the pdf objects to new one except the images to be modified. In place of
> these images I can add my changed images to new pdf.

That's another solution, true.

> Please guide if any of this is feasible, please share if you have any other
> option in mind.

All depends on the complexity of the document(s) you want to modify.
If you only want to change 2 occurences of an image in a 100 page
document, I would definetely go for the first option. OTOH, if the
document is a single page one, with 20 images you have to change, the
second option might be a wiser choice.

HTH,
alexis

-------------------------------------------------------------------------
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&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions