> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of AnhTuan Nguyen
> Sent: Tuesday, October 03, 2006 10:21 AM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] How to launch javascript code
> for PDF formfields event.
>
> Hi Bruno,
> Right now, i have found out the way to attach the javascript
> code for form field event. The method PDFStamper.addScript()
> and PDF javascript at document level was used to that. The
> script is below:
>
> var f; var count = 0;
> for ( var i=0; i<this.numFields; i++) {
> var fname = this.getNthFieldName(i);
> f =this.getField(fname);
> console.println("There are:" + f.name);
> f.setAction("MouseUp","app.alert('Thanks for selecting the
> first choice.')");
> }
>
> But i'm only sucessful in case that PDF form created by
> itext. Otherwise, It will be failed in case that PDF form
It's not iText specific, it's called an Acrobat form as opposed to a
Designer form.
> created by Acrobat Designer. This is an message message:
>
> "NotAllowedError: Security settings prevent access to this
> property or method.
> Field.setAction:6:Document-Level:0"
> I don't know how to sovle this problem. If you could, please
> help me on this issue.
>
Designer forms are a completely different beast. You'll have to put the
javascript in the XFA. See
http://partners.adobe.com/public/developer/en/xml/xfa_spec_2_4.pdf.
Paulo
> Thanks for your reply,
> Best Regards,
> Tuan.
>
>
> "Bruno Lowagie (iText)" <[EMAIL PROTECTED]> wrote:
>
> AnhTuan Nguyen wrote:
> > Thanks for your reply quickly,
> > I can do as your description, but i would like to
> know the way how to
> > get the existing form field, and add the java script
> code for this field.
> > I can't find out the any methods in order to get
> existing form field.
>
> That's too difficult to explain in a mail message.
>
> I have a very small example in chapter 18 of the book,
> but this example won't help you if you haven't read
> the other chapters.
>
> You need PdfReader and PdfStamper, you need to know
> how to find the PDF objects (dictionaries) that describe
> the form field, and you need to read the specific chapters
> on form fields in the PDF Reference.
>
> br,
> Bruno
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions