Skip to main content
Known Participant
May 28, 2024
Question

Document is Protected - How do I Enter Permissions Password?

  • May 28, 2024
  • 1 reply
  • 370 views

i know the password , but removing protection is failing

emoveProtectionOperation removeProtectionOperation = RemoveProtectionOperation.CreateNew();

// Set operation input from a source file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"test.docx");
removeProtectionOperation.SetInput(sourceFileRef);

// Set the password for removing security from a PDF document.
removeProtectionOperation.SetPassword("password");

// Execute the operation.
FileRef result = removeProtectionOperation.Execute(executionContext);

    This topic has been closed for replies.

    1 reply

    Raymond Camden
    Community Manager
    Community Manager
    May 28, 2024

    You are trying to remove a password from a Word doc, not a PDF. That won't work.