PPTX DOCX XLSX PDF ODP
Aspose.PDF  for .NET
PDF

Managing AcroForms to PDF document via C#

Build your own .NET apps to create Fillable document files using server-side APIs.

Create AcroForm PDF document via C#

You need aspose.pdf.dll to try the code in your environment.

  • Load PDF in an instance of Document class
  • Access the Page via its index
  • Create the form field you want to add
  • Call the Form collection’s Add method.
  • Save the file.

System Requirements

Aspose.PDF for .NET is supported on all major operating systems. Just make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with .NET Framework, .NET Core, and PHP, VBScript, Delphi, C++ via COM Interop.
  • Development environment like Microsoft Visual Studio.
  • Aspose.PDF for .NET DLL referenced in your project.
 

Create Acroform in PDF - C#

    // Open document
    Document pdfDocument = new Document(dataDir + "TextField.pdf");

    // Create a field
    TextBoxField textBoxField = new TextBoxField(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(100, 200, 300, 300));
    textBoxField.PartialName = "textbox1";
    textBoxField.Value = "Text Box";

    // Create decorations (like Border)
    Border border = new Border(textBoxField);
    border.Width = 5;
    border.Dash = new Dash(1, 1);
    textBoxField.Border = border;

    textBoxField.Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Green);

    // Add field to the document
    pdfDocument.Form.Add(textBoxField, 1);

    dataDir = dataDir + "TextBox_out.pdf";
    // Save modified PDF
    pdfDocument.Save(dataDir);
 
  • About Aspose.PDF for .NET API

    Aspose.PDF API can be used for PDF document manipulation and parsing within applications. One can create, modify, compress, secure, print or save PDF to TXT, HTML, PCL, XFA, XML, XPS, EPUB, TEX, Images and more formats. Aspose.PDF is a standalone API and it does not depend on any software including Adobe Acrobat.

    Convert XFA form to Acrofrom in PDF via Online App

    Convert XFA form in PDF file to more popular AcroForms right now by visiting our Live Demos website. The live demo has the following benefits

      No need to download or setup anything
      No need to write any code
      Click Convert button. Your PDF files will be uploaded and will be converted to format.
      Instantly get the download link for the resultant file

    PDF What is PDF File Format

    Portable Document Format (PDF) is a type of document created by Adobe back in 1990s. The purpose of this file format was to introduce a standard for representation of documents and other reference material in a format that is independent of application software, hardware as well as Operating System. PDF files can be opened in Adobe Acrobat Reader/Writer as well in most modern browsers like Chrome, Safari, Firefox via extensions/plug-ins. Most of the commercially available software suites also offer conversion of their documents to PDF file format without the requirement of any additional software component. Thus, PDF file format has full capability to contain information like text, images, hyperlinks, form-fields, rich media, digital signatures, attachments, metadata, Geospatial features and 3D objects in it that can become as part of source document.

    Read More