Decrypt PDF using C# REST API

This tutorial guides on how to Decrypt PDF using C# REST API. You will learn removing password from PDF using C# REST API with the help of .NET-based Cloud SDK. You will get assistance to upload a file for the operation and download the decrypted file from the Cloud storage.

Prerequisite

Steps for Removing Password from PDF Document using C# Low Code API

  1. Import necessary classes and modules from the library
  2. Create the PdfApi object by setting the API secret and ID
  3. Load the encrypted PDF file into a file stream
  4. Convert the PDF password to a base 64 string
  5. Invoke the PutDecryptDocument method by passing the necessary parameters
  6. Call the DownloadFile method to retrieve the updated PDF file

The above programming steps decrypt PDF document using C# .NET-based API. Create the PdfApi object, read and load the source PDF file into a memory stream, set the password for opening the PDF, and convert it to a Base 64 string for passing it as a parameter. Finally, call the PutDecryptDocument method to decrypt the file and use the DownloadFile method to retrieve the decrypted PDF from the Cloud storage.

Code for Removing Password from PDF Online using C# REST Interface

This code can be used to decrypt PDF online using C# REST API. When you call the PutDecryptDocument() method, you pass the out file name that is used to save the resultant decrypted PDF file in the Cloud storage. The same is used by the Download method to retrieve the updated PDF file.

This article has taught us the process of removing a password from a PDF file. To set a password in a PDF file, refer to the article Add Password Protection to PDF using C# REST API.