HTML JPG PDF XML DOCX
  Product Family
PDF

Remove PDF Forms in .NET SDK

Delete a form field from a PDF document using Aspose.PDF Cloud .NET SDK

Get Started

How to Delete Form Fields in PDF Document using Cloud .NET SDK

In order to remove Form Fields via Cloud .NET SDK , we’ll use Aspose.PDF Cloud .NET SDK This Cloud SDK allows you to easily build cloud-based PDF creator, editor & converter apps in C#, ASP.NET, or other .NET languages for various cloud platforms. Open NuGet package manager, search for Aspose.PDF Cloud and install. You may also use the following command from the Package Manager Console.

Package Manager Console Command


     
    PM> Install-Package Aspose.Pdf-Cloud
     
     

Steps to remove AcroForms via .NET SDK

Aspose.PDF Cloud developers can easily load & delete acroforms in PDF in just a few lines of code.

  1. Create a new Configuration object with your Application Secret and Key
  2. Create an object to connect to the Cloud API
  3. Upload your document file
  4. Perform the removing
  5. Download the result
 

This sample code shows removing Form Fields in PDF documents


    public static void RemoveFormField()
    {
        const string localImageFileName = @"C:\Samples\StudentInfoFormElectronic.pdf";
        const string storageFileName = "StudentInfoFormElectronic.pdf";
        // Get your AppSid and AppSecret from https://dashboard.aspose.cloud (free registration required).            
        var pdfApi = new PdfApi(AppSecret, AppSid);
        var filesOnStorage = pdfApi.GetFilesList("");
        if (filesOnStorage.Value.All(f => f.Name != storageFileName))
        {
            using var file = File.OpenRead(localImageFileName);
            var uploadResult = pdfApi.UploadFile(storageFileName, file);
            Console.WriteLine(uploadResult.Uploaded[0]);
        }

        var response = pdfApi.DeleteField(storageFileName, "First Name");
        Console.WriteLine(response.Status);
    }