Click here to Skip to main content
15,039,149 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to disable Save a PDF document
Sandeep Mewara 13-Sep-10 11:50am
We are not magicians please. Your question has no meaning to us. Care to elaborate?

Why would you want to disable it? Even if you did, you could still download the PDF using other methods.
AspDotNetDev 13-Sep-10 16:05pm
When viewing a PDF online, the user is able to save a copy to the hard drive by clicking the "Save As" button. There may very well be a way to disable this so that it is only viewable online, such as commonly done with streaming videos (think of it as a streaming document). There may be other ways of downloading the content, but having barriers can help reduce piracy.
adib.iman 13-Sep-10 16:39pm
because i want no body can change my pdf, only read my document online
Ved Praksh 15-Mar-13 6:16am
Can some body let me know how to disable Save button ?
Hi here is the solution use these code
using (MemoryStream input = new MemoryStream(renderedBytes))
                    using (MemoryStream output = new MemoryStream())
                        PdfReader reader = new PdfReader(input);
                        reader.AddViewerPreference(PdfName.HIDEMENUBAR, PdfName.NONE);
                        // PdfEncryptor.Encrypt(reader, output, true, CertificatePassword, CertificatePassword, PdfWriter.ALLOW_SCREENREADERS);
                        PdfEncryptor.Encrypt(reader, output, true, null, null, PdfWriter.ALLOW_PRINTING | PdfWriter.AllowPrinting | PdfWriter.ENCRYPTION_AES_128 | PdfWriter.CenterWindow);
                        renderedBytes = output.ToArray();
                        Response.ContentType = "application/pdf";

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900