Hi all,

Anybody knows how to execute JavaScript code that may only be executed during

initialization of the document.

I want to use the app.hideMenuItem() function, but cannot get it to run.
While other methods will run as they are not limited due to 'pdf security'
rules. 

Code that wont work:

--snip---
document.open();
PdfAction jAction = PdfAction.javaScript("app.hideMenuItem(\"Hand\");\r",
writer);
writer.addJavaScript(jAction);
--snip end--

Code that will work:
--snip--
document.open();
PdfAction jAction = PdfAction.javaScript("app.execMenuItem(\"Open\");\r",
writer);
writer.addJavaScript(jAction);
--snip end--

Also I tried in stead of addJavaScript the writer.setOpenAction(jAction);
method, but I think this is even before initialization, so it will not run
either. 

Thanks,

Martin

from the pdf javascript reference manual:
This method can only be executed during application initialization or
console events. See the Event Object for a discussion of Acrobat JavaScript
events.

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to