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

Free Support Forum - aspose.com

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 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 PDF file by using following code snippet.

[C#]

PdfContentEditor editor = new
PdfContentEditor();<o:p></o:p>

// 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”);