Hello

I had a similar, but not same problem.

-Differences between our projects:
-I had only to replace "my own" elements - so I added the content also as 
hidden acrofield (to find)
- I think you should find your stamps with PdfName...

To work with PdfDictionary is a nice mechanism you can use to manipulate 
several things.

The following code snipplet may help you:



                PdfDictionary pagedict = inPdf.getPageN(actualPage);
                    if (pagedict.get(PdfName.RESOURCES) == null) {
                        ....
                        return;
                    }
                    PdfDictionary resources;
                    try {
                        resources = (PdfDictionary) pagedict.get(
                                PdfName.RESOURCES);
                    } catch (ClassCastException cc) {
                        ...
                    }
                    if (resources == null) {
                        ....
                    }
                    PdfDictionary xobjects = (PdfDictionary) resources.get(
                            PdfName.XOBJECT);
                    for (Iterator xobjIt = xobjects.getKeys().iterator();
                            xobjIt.hasNext();) {
                        xobject = xobjects.get((PdfName) xobjIt.next());
                        PRStream template = (PRStream) PdfReader.
                            getPdfObject(xobject);
                        String templateString;
                        try {
// Patrick Hartmann: Here is the difference!
                            templateString = new String(
                                    PdfReader.getStreamBytes(template));
                        } catch (Exception ex) {
                            ....
                        }
                        if (fieldString.equals(templateString)) { // Patrick 
Hartmann: Here is the difference!                                               
                           template.setData(
                           "...Patrick Hartmann: set your new text 
here".getBytes());
                           ....
                        }
                    }

Best regards,
Sascha Fuchs

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Patrick Hartmann
Gesendet: Mittwoch, 16. Mai 2007 09:05
An: [email protected]
Betreff: Re: [iText-questions] remove/edit annotation

I still have this "problem".
Has nobody an idea?

Thanks
Patrick Hartmann


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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