Disable Save option in PDF

Hi,

I am trying to disable the Print and Save options available in the output PDF but on adding the below code, only Print feature is disabled. I am currently using Adobe Reader XI.

DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
privilege.AllowCopy = false;
privilege.AllowPrint = false;

PdfFileSecurity fileSecurity = new PdfFileSecurity(inputFilePath, outputFilePath);
fileSecurity.SetPrivilege(privilege);

Can you please let me know what i am missing here ?

Regards,

Smita

Hi Smita,

Thanks for using our products and sorry for the delayed response.

Aspose.Pdf for .NET is based on Adobe PDF specifications and the requirement to disable the Save option of PDF viewing application cannot be accomplished because this behavior depends upon the viewer application. We are sorry for this inconvenience.

PS, you may consider specifying the viewer preference of a PDF file by using the following code snippet.

C#

PdfContentEditor editor = new PdfContentEditor();

// bind the source PDF file
editor.BindPdf("c:/pdftest/Statement+Of+Fact.pdf");

// set the viewer preference
editor.ChangeViewerPreference(Aspose.Pdf.Facades.ViewerPreference.HideToolbar);

// save updated document
editor.Save("c:/pdftest/NoUI.pdf");