Brijoy, For the save button I have no idea, but the print button can be "disabled" with a trick. In Acrobat one can create objects that are 'not visible but printable' (I'm sure iText can manipulate these properties as well). What we did to avoid users using the print button in the toolbar was to create a rectangle with the above mentioned properties and sized this rectangle to encompass the whole page/pages. This rectangle also contained a text like "Printing this documnet is not allowed". When the user pressed the print button nothing on the printed page was visible but this warning message. The nice thing is that you can control when and how this 'print guard' kicks in by setting its printable property to true or false (we used this with acroforms to force users using our custom print button that also validated field contents before printing).
Best regards, Dániel Kékesi http://www.kekesi.com On 2011.12.16. 22:27, Brijoy Janardhanan wrote: > Hello > > We badly need a solution. We cannot want to introduce a new logic to handle > pdf and confuse the users. > Right now in all versions of pdf the itext has an option to disable the tool > bar option, which will allow the users not to save the sensitive information > to the desktop. In Adobe X it created a issue, by highlighting the toolbar > option and makes the iText code not to work. > > Can somebody help me out and give a feasible solution? > > Thanks > Brijoy > > > > > -------============================== > Message: 2 > Date: Fri, 9 Dec 2011 17:48:02 -0000 > From: "John Renfrew" <[email protected] <mailto:[email protected]>> > Subject: [iText-questions] FW: Question on hiding toolbar in Adobe X > To: "'Post all your questions about iText here'" > <[email protected] > <mailto:[email protected]>> > Message-ID: <012d01ccb69a$b308a9d0$1919fd70$@com> > Content-Type: text/plain; charset="us-ascii" > > Leonard, Brijoy > > > > On win7 if I add a null user password and turn everything off (printing > commenting etc) it will NOT show the toolbars when inside browser... > > > > john renfrew > > From: Leonard Rosenthol [mailto:[email protected] > <mailto:[email protected]>] > Sent: 09 December 2011 17:11 > To: Post here > Subject: Re: [iText-questions] Question on hiding toolbar in Adobe X > > > > Hiding the toolbar was never the way to "prevent saving" - you just avoided > the real problem. And yes, there is no way to hide the toolbar (or the > HUD) in the browser. > > > Message: 1 > Date: Fri, 9 Dec 2011 09:10:52 -0800 > From: Leonard Rosenthol <[email protected] <mailto:[email protected]>> > Subject: Re: [iText-questions] Question on hiding toolbar in Adobe X > To: Post here <[email protected] > <mailto:[email protected]>> > Message-ID: <cb077f07.126b5%[email protected] > <mailto:cb077f07.126b5%[email protected]>> > Content-Type: text/plain; charset="us-ascii" > > Hiding the toolbar was never the way to "prevent saving" - you just avoided > the real problem. And yes, there is no way to hide the toolbar (or the HUD) > in the browser. > > From: Brijoy Janardhanan <[email protected] > <mailto:[email protected]><mailto:[email protected] <mailto:[email protected]>>> > Reply-To: Post here <[email protected] > <mailto:[email protected]><mailto:[email protected] > <mailto:[email protected]>>> > Date: Fri, 9 Dec 2011 07:56:34 -0800 > To: Post here <[email protected] > <mailto:[email protected]><mailto:[email protected] > <mailto:[email protected]>>> > Subject: [iText-questions] Question on hiding toolbar in Adobe X > > Hello > > We are using iText 2.1.2 jar for our project. Issue we are facing is we are > not able to hide the toolbar in the Adobe Reader 10 version. The code works > well for Adobe 9 and lower version to hide the toolbar and menubar. Right now > in Adobe X, the toolbar is enabled and allows the customer to save the pdf to > local desktop. This should not happen. Can you suggest a way ? > > Snapshot of code: > > -------------------------------- > com.lowagie.text.Document document =null; > > reader = new PdfReader(outByte); > if (reader.isEncrypted()) { > reader = new PdfReader(outByte, "test".getBytes()); > } > int totalPages = reader.getNumberOfPages(); > PdfCopy copy = new PdfCopy(document, new FileOutputStream(fileName)); > copy.setViewerPreferences(PdfWriter.HideMenubar); > copy.setViewerPreferences(PdfWriter.HideToolbar); > copy.setEncryption(null, "test".getBytes(), > PdfWriter.ALLOW_MODIFY_CONTENTS, > PdfWriter.ENCRYPTION_AES_128); > document.open(); > ------------------------------------------ > > > Regards > Brijoy > > > ------------------------------------------------------------------------------ > Learn Windows Azure Live! Tuesday, Dec 13, 2011 > Microsoft is holding a special Learn Windows Azure training event for > developers. It will provide a great way to learn Windows Azure and what it > provides. You can attend the event by watching it streamed LIVE online. > Learn more at http://p.sf.net/sfu/ms-windowsazure > > > > _______________________________________________ > 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 ------------------------------------------------------------------------------ Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure _______________________________________________ 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
