Op 19/03/2012 12:21, Larry Evans schreef:
> I have studied the TextFieldActions example which you cited:
>
>    http://itextpdf.com/examples/iia.php?id=238
>
> In particular, in that example, there's:
>
>          TextField name = new TextField(writer, new Rectangle(130, 806,
> 256, 780), "name");

TextField is a class that can only be used to CREATE new forms from scratch.
You can't use it to change existing forms.

> However, my problem is that the .pdf file I'm starting from is:
>
>    http://www.irs.gov/pub/irs-pdf/f1040.pdf
>
> and I couldn't figure a way to get a TextField from that.

Correct. You shouldn't attempt to get a TextField object when dealing 
with an existing PDF.


>    I could only
> find a way to get an AcroFields.Item from an AcroFields and a field
> name;

That's what you need to do.

>   however, I could not figure how to get a PdfFormField from an
> AcroField.

That's not possible. Just like TextField, PdfFormField is used for form 
CREATION only, not for form manipulation. You're on the wrong track if 
that's what you're trying to do.

> Item which I could then use to setAdditionalActions.

You need to add the infrastructure that is needed for an Additional 
Action on the lowest level /AA and related dictionaries.

If it doesn't work, something in your infrastructure is missing. I'm 
working on other assignments, so I don't have the time to look at any 
actual PDFs.

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to