Hello Shivaji Dole,
[1.] You are not subscribed to the mailing-list. Somebody had to approve
your question manually. Please read the blog-post:
http://itextpdf.com/nabble and watch
https://www.youtube.com/watch?v=IV4dzXDRzJE
After watching the short video, you'll understand that you should at
least register to the list. If Infosys is using iText, you may already
be a customer. Please check with your project manager to find out if you
have a support contract to get access to the support system.
[2.] Unfortunately, your question is not a valid iText question for
different reasons.
You are talking about behavior that works in the Adobe Reader plug-in
that is used in Microsoft Internet explorer, but that doesn't work in
Chrome PDF Viewer in Chrome, nor in pdf.js in Mozilla Firefox. You have
established that the functionality you need works in one viewer, but not
in two other viewers. This means that you should contact Google
regarding the problem in Chrome's PDF viewer and Mozilla regarding the
problems in pdf.js as the cause of the problem is the viewer, not the PDF.
However, when I look at the reasons why you want to hide the toolbar, I
discover a serious flaw in your reasoning.
You want to make sure that the end-user can't print the document.
This can be achieved by encrypting your document. A document can be
encrypted using two passwords: a user password and an owner password. If
you use a user password, the person opening the document will have to
enter a password before he can see the document. If you omit the user
password, everybody can view the PDF, but whoever doesn't know the owner
password, will have to obey the permissions defined upon encrypting, for
instance: "printing not allowed". Note that adding an owner password
only adds weak protection; there are many known workarounds (not all of
them legal) to circumvent restrictions.
You want to make sure that the end-user can't download the document.
That's... a strange request as the only way to avoid downloading a
document, is to avoid that the end-user ever sees the document. PDF
viewers require that the file can be accessed on a local disk, so each
PDF shown in a browser is ALWAYS downloaded (in a temp folder).
Hiding the toolbar to avoid "Save As" is also absurd because you can't
hide the HUD (Heads Up Display):
http://stackoverflow.com/questions/23081728/disable-adobe-reader-toolbar-from-my-activex/
People can also use "hot keys" and other ways to print/save a document
(they don't need the toolbar to do that).
See also:
http://stackoverflow.com/questions/22880444/disable-save-button-in-adobe-pdf-reader-and-hide-menu-bar-in-ie-window
On 4/28/2014 9:49 AM, Shivaji Dole wrote:
Hi,
Greetings!
We are using iText to generate the pdf file, and show in the browser
as part of preview.
We are facing a challenge of disabling the print, save pdf file from
the browser, this is client requirement to protect the document, this
should be only viewable, but not to download/save and print directly.
Please suggest us on this as how we can achieve this.
Currently I am using the below two code snippets, to disable the
toolbar, it works fine in IE browser, but not in other browsers like,
*Chrome and FireFox*.
1.Appending the #toolbar=0&navpanes=0 at the end of the url, of
the pdf file.
2.Adding encryption using setEncryption() method of PDFstamper
pdfStamper.setEncryption(null, null, PdfWriter.ALLOW_SCREENREADERS,
PdfWriter.DO_NOT_ENCRYPT_METADATA);
please let us know if you have any workaround to achieve this.
*Thanks & Regards*,
*Shivaji Dole*,
Infosys Limited, SEZ , Hyderabad.
T: +91 40 30968059(Ext: 68059)
M: +91 8008 456 457
cid:image002.png@01CE8E9E.FEB27BD0
Stay Connectedcid:image003.gif@01CE8E9E.FEB27BD0
<https://twitter.com/Infosys>cid:image004.gif@01CE8E9E.FEB27BD0
<http://www.linkedin.com/company/1283>cid:image005.gif@01CE8E9E.FEB27BD0
<http://www.youtube.com/InfosysTechnologies>cid:image006.gif@01CE8E9E.FEB27BD0
<http://www.slideshare.net/Infosys>
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are
not
to copy, disclose, or distribute this e-mail or its contents to any other
person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has
taken
every reasonable precaution to minimize this risk, but is not liable for any
damage
you may sustain as a result of any virus in this e-mail. You should carry out
your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this
e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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