hi
well how the image replaced
if image replaced then there should be any machanism which will also change
the text
Waq
PdfReader pdf = new PdfReader("Imagesletter.pdf");
PdfStamper stp = new PdfStamper(pdf, new
FileOutputStream("out.pdf"));
PdfWriter writer = stp.getWriter();
Image img = Image.getInstance("spiderman01.jpg");
PdfDictionary pg = pdf.getPageN(1);
PdfDictionary res = (PdfDictionary)
PdfReader.getPdfObject(pg.get(PdfName.RESOURCES));
PdfDictionary xobj = (PdfDictionary)
PdfReader.getPdfObject(res.get(PdfName.XOBJECT));
boolean flag = true;
int count = 0;
if (xobj != null) {
for (Iterator it = xobj.getKeys().iterator(); it.hasNext();
) {
count++;
PdfObject obj = xobj.get((PdfName) it.next());
if (flag) {
flag = false;
continue;
}
if (obj.isIndirect()) {
PdfDictionary tg = (PdfDictionary)
PdfReader.getPdfObject(obj);
PdfName type = (PdfName)
PdfReader.getPdfObject(tg.get(PdfName.SUBTYPE));
if (PdfName.IMAGE.equals(type)) {
PdfReader.killIndirect(obj);
Image maskImage = img.getImageMask();
if (maskImage != null) {
writer.addDirectImageSimple(maskImage);
}
writer.addDirectImageSimple(img,
(PRIndirectReference) obj);
break;
}
}
}
}
System.out.println(count);
stp.close();
----Original Message Follows----
From: "Paulo Soares" <[EMAIL PROTECTED]>
Reply-To: itext-questions@lists.sourceforge.net
To: <itext-questions@lists.sourceforge.net>
Subject: Re: [iText-questions] Cell data replace
Date: Thu, 25 May 2006 20:09:54 +0100
That's not possible to do with PDFs.
Paulo
----- Original Message ----- From: "Waq lala" <[EMAIL PROTECTED]>
To: <itext-questions@lists.sourceforge.net>
Sent: Thursday, May 25, 2006 4:16 PM
Subject: [iText-questions] Cell data replace
Hi
I want to get a cell of a table in the PDF. After some changes i want to
copy that cell into a table of a new PDF file.
Changes are like, that I do change the text of the cell and that cell I
want to copy to the new PDF file table
thanx
Waq
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions