16,012,352 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Gurupatham (Top 7 by date)
Gurupatham
27-Apr-15 0:52am
View
Hi Atul Dhiman,
Did You find out the solution for disable save as button in PDF? If you find out the option please share with me (above you posted code very very useful for me)
Gurupatham
22-Apr-15 6:55am
View
OK I Accept your answer,but in my application worked as user rights depend.we've plan to give only view rights for some confident pdf files(not save/copy/print option).so how to solve this problem in .net?
Gurupatham
22-Apr-15 6:25am
View
we tried iframe to load the pdf file content and also disable iframe navigation panel but IE browser able to download that pdf file thru File --> save as option.If there's any alternative solutions for only display the pdf contents?
Gurupatham
22-Apr-15 5:43am
View
Any other solutions for just display the pdf contents(not allow download/save/print) in .net?
Gurupatham
22-Apr-15 5:37am
View
Deleted
Any other solutions for just display the pdf contents(not allow download/save/print) in .net?
Gurupatham
22-Apr-15 2:55am
View
Hi Sergey Alexandrovich Kryukov,
I Developed file storage application in C#.net,Admin user upload the pdf files from that system,In specific requirement user can view only the content of pdf file and not allow to save local drive and also not allow to take printout.I findout solutions to disable pdf print option using iTextsharp but yet to not find the solution for disable save as option in pdf file.if there's any options and soltution please share with me.
Below mentioned code for disable print button in pdf file
--------------------------------------------------
using iTextSharp;
using iTextSharp.text;
using iTextSharp.text.pdf;
protected void Page_Load(object sender, EventArgs e)
{
string WorkingFolder = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string InputFile = Path.Combine(WorkingFolder, "StickerSheet_New.pdf");
string OutputFile = Path.Combine(WorkingFolder, "2.pdf");
using (Stream input = new FileStream(InputFile, FileMode.Open, FileAccess.Read, FileShare.Read))
{
using (Stream output = new FileStream(OutputFile, FileMode.Create, FileAccess.Write, FileShare.None))
{
PdfReader reader = new PdfReader(input);
//PdfEncryptor.Encrypt(reader, output, true, "23!54", "23!54", PdfWriter.ALLOW_SCREENREADERS);
System.Text.UTF8Encoding Encoding = new System.Text.UTF8Encoding();
PdfStamper stamper = new PdfStamper(reader, output);
stamper.SetEncryption(Encoding.GetBytes("23!54"), null, PdfWriter.AllowScreenReaders, PdfWriter.STRENGTH40BITS );
//output.ViewerPreferences.HideToolbar = true;
//PdfReader pReader = new PdfReader();
//PdfEncryptor.Encrypt(reader, new FileStream("1.pdf", FileMode.Open), PdfWriter.STRENGTH128BITS, "23!54", null, PdfWriter.AllowScreenReaders);
stamper.Close();
reader.Close();
Response.Write("PDF created");
}
}
}
}
}
Gurupatham
21-Apr-15 8:26am
View
How to disable pdf file save as button using iTextsharp (PdfStamper)? or any other solutions...?
Show More