I'm pretty sure that even if you do manage to call a JS function to close the document, the security manager will let the user choose whether or not to allow it.
Wow. doc.closeDoc(); And the only "security" issue is whether or not the document has been changed and what to do about it. Users can still disable JS and view your document however. And you can create a field that covers the entire page (on every page) and is hidden in script. And they can download the PDF, open it in Acrobat Pro, and delete the annotation, strip the script, and read it anyway. They could do much the same with iText if they knew which annotation to look for. Not many people would be able to work around the "obscuring annotation" trick, but it is definitely possible. And it only takes one person to put your PDF on a file sharing system (torrent, public FTP, whatever) to spread it around. What are you trying to accomplish? --Mark Storer Senior Software Engineer Cardiff.com import legalese.Disclaimer; Disclaimer<Cardiff> DisCard = null; > -----Original Message----- > From: 1T3XT info [mailto:i...@1t3xt.info] > Sent: Saturday, August 21, 2010 1:34 AM > To: Post all your questions about iText here > Subject: Re: [iText-questions] issue with hidden field > > On 20/08/2010 6:23, thangam mani wrote: > > a. Use the form created by Acrobat Pro and add a hidden > field in that > > form using *ITEXT* > > Doable. You could add an invisible Text field. > > > b. Invoke a script on opening the PDF which should validate > the hidden > > field value with a hardcoded value, if validation fails the > PDF should > > not be opened c. If validation succeeds PDF should be opened > > This would involve JavaScript, and I'm not sure if what you > want to do is even possible. It won't work if the end-user > has disabled JavaScript execution, and some of the functions > you'll want to use may or may not work because of security > reasons (I'm not sure if you can close a document using a JS > function). > -- > This answer is provided by 1T3XT BVBA > http://www.1t3xt.com/ - http://www.1t3xt.info > > -------------------------------------------------------------- > ---------------- > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.itextpdf.com/book/ Check the > site with examples before you ask questions: > http://www.1t3xt.info/examples/ You can also search the > keywords list: http://1t3xt.info/tutorials/keywords/ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.851 / Virus Database: 271.1.1/3083 - Release > Date: 08/22/10 23:35:00 > ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/