Created
March 4, 2024 05:45
-
-
Save conholdate-com-kb/40412b77c4711722d6dae9da002e8ffb to your computer and use it in GitHub Desktop.
How to Remove All Restrictions from PDF in C#. For more details: https://kb.conholdate.com/total/net/how-to-remove-all-restrictions-from-pdf-in-csharp/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Pdf; | |
using Aspose.Pdf.Facades; | |
class Program{ | |
static void Main(string[] args) // Remove PDF restrictions in C# | |
{ | |
// Set PDF license | |
new License().SetLicense("Aspose.Total.lic"); | |
// Create PdfFileSecurity object | |
PdfFileSecurity fileSecurity = new PdfFileSecurity(); | |
fileSecurity.BindPdf("PrivilegesApplied.pdf"); | |
// Create DocumentPrivileges object | |
DocumentPrivilege privilege = DocumentPrivilege.AllowAll; | |
fileSecurity.SetPrivilege(privilege); | |
fileSecurity.Save("PrivilegesRemoved.pdf"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment