Stanley Bondi wrote:
> Using the iTextSharp API,
> I can get the acrofields and I can get the javascript in the PDF,
> I want to find the javascript event handler name for a field in a acroform.
You can get the javascript (1)
You can't find the javascript event handler (2)
> Im assuming that javascript event handler functions are called (if
> set) when some event occurs in a field.
You are probably referring to MouseUp, Keystroke, Focus, Blur,...
as described in chapter 15 of the iText book or section 8.5 in
the PDF Reference (Tables 8.44, 8.45, 8.46, 8.47).
> for example
> if i have a text field, that must contain digits, some event is
> triggered when the field is tabbed to the next field(the event
> - OnValidate or something -calls a javascript function that checks that
> the textfield contains only digits)
> I would like to know the name of the method called.
The name of the method called?
Do you mean the piece of JavaScript similar to what you
retrieve when you do (1)? Or do you mean you don't know
the keys for each (2) as described in section 8.5 of the
PDF Reference?
> In one of your examples:
>
> Paragraph p = new Paragraph(new Chunk("Click to say
> Hello").setAction(PdfAction.javaScript("app.alert('Hello');\r", writer)));
>
> I want the action that you set, so something like
> pdfReader.getAction(fieldname) or field.getAction() or fieldInfo.Action
> and get the name of the function that is called on the event.
Again, the analogy is wrong.
When you set an action for a Chunk, there are no text fields
involved. An annotation of a specific type is created; there
is no 'fieldname' involved.
I suggest that you start reading section 8.5 of the PDF Reference
(downloadable for free from adobe.com); I think that's what you need.
br,
Bruno
-------------------------------------------------------------------------
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/