We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Securing and opening PDF displayed in client browser

Hi Team,


I have been looking around for watermarking and securing PDF content that is displayed on client browser. We have .net mvc backend to service internal client request to open a pdf document from browser. We are looking into watermarking and securing the opened document.

Requirement is that when the user opens the document from the application we will allow the user (already authenticated from the app) to view the PDF without asking for password.
When the user tries to save/print/copy the document action should be disabled/not show the options.

How do you address this problem with Aspose Pdf security.

Thanks,
Velugula

Hi I tried the evaluation version of Aspose PDF and its really developer friendly to start using it right out of the box. Thanks for making it that way.


Code snippets:
string ownerPwd = β€œAES256”;
string userPwd = β€œβ€;
var outStreamEncrypt = new MemoryStream();
//open document using Aspose pdf
PdfFileSecurity fileSecurity = new PdfFileSecurity(inStream, outStreamEncrypt);
fileSecurity.EncryptFile(userPwd, ownerPwd, DocumentPrivilege.ForbidAll, KeySize.x256, Algorithm.AES);

I am able to add watermark (Text).

I tried to encrypt as below and noticed that
1. Print is disabled but SAVE is still enabled as in the attachement.
2. Once the document is closed, I would like forbid the user from re-opening it from his local temp location. Right now it is not stopping the user.

How to achieve both of the above? Your prompt feedback is much appreciated.

thanks,
Kumar

velugula:
I tried to encrypt as below and noticed that
1. Print is disabled but SAVE is still enabled as in the attachment.
Hi Kumar,

Thanks for contacting support.

The save button and other options are rendered by document viewer control (Adobe Reader) and I am afraid Aspose.Pdf for .NET cannot disable/control options for document viewer. Please note that Aspose.Pdf for .NET is developed according to PDF format specifications and it cannot control the viewing application.
velugula:
2. Once the document is closed, I would like forbid the user from re-opening it from his local temp location. Right now it is not stopping the user.
In order to display the document, Adobe reader first downloads the file to local system and then displays it inside the browser.

velugula:
How to achieve both of the above? Your prompt feedback is much appreciated.
As a workaround to your above problems, you may consider using ViewerApp of our sister company named GroupDocs to view PDF file. In the event of any further query, please feel free to contact.