Your account has been flagged due to frequent spamming, you are not permitted to post comments. Contact email@example.com.
How to remove restrictions for a secured PDF..? C#
over 7 years agoAnswer it
over 7 years ago
The password of secured PDF is mandatory to copy its content. You can open PDF file by this method: Spire.Pdf.PdfDocument(string filename, string password) Then, modify passwords by resetting owner password and user password as empty. Below shows the whole code of modifying passwords of secured PDF file,
//load a encrypted file and decrypt it string input = @"C:\xxxx\2006-Catalog.pdf"; string output = @"C:\xxxx\Unlocked-2006-Catalog.pdf "; PdfDocument doc = new PdfDocument(input, "password"); //reset PDF passwords and set user password permission doc.Security.OwnerPassword = ""; doc.Security.UserPassword = ""; doc.Security.Permissions = PdfPermissionsFlags.Print | PdfPermissionsFlags.FillFields; //Save pdf file. doc.SaveToFile(output); doc.Close();
if you find the answer helpful please mark it correct, so that, other developmentnt community can take advantage.
almost 7 years ago
Use iTextSharp which works better & easy with many features.