This sample shows how to add text fields to your PDF document using PdfPage.AddTextBox(..) method.

AddTextBox method returns an instance of PdfTextBox class.

CopyC#
using System.Diagnostics;

namespace BitMiracle.Docotic.Pdf.Samples
{
    public static class TextFields
    {
        public static void Main()
        {
            // NOTE: 
            // When used in trial mode, the library imposes some restrictions.
            // Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            // for more information.

            PdfDocument pdf = new PdfDocument();

            PdfPage page = pdf.Pages[0];
            PdfTextBox textBox = page.AddTextBox(10, 50, 100, 30);
            textBox.Text = "Hello";

            PdfTextBox textBoxWithMaxLength = page.AddTextBox(10, 90, 100, 30);
            textBoxWithMaxLength.MaxLength = 5;

            PdfTextBox passwordTextBox = page.AddTextBox(10, 130, 100, 30);
            passwordTextBox.Text = "Secret password";
            passwordTextBox.PasswordField = true;

            string pathToFile = "TextFields.pdf";
            pdf.Save(pathToFile);
            pdf.Dispose();

            Process.Start(pathToFile);
        }
    }
}
CopyVB.NET
Imports System.Diagnostics

Imports BitMiracle.Docotic.Pdf

Namespace BitMiracle.Docotic.Pdf.Samples
    Public NotInheritable Class TextFields
        Public Shared Sub Main()
            ' NOTE: 
            ' When used in trial mode, the library imposes some restrictions.
            ' Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            ' for more information.


            Dim pdf As New PdfDocument()

            Dim page As PdfPage = pdf.Pages(0)
            Dim textBox As PdfTextBox = page.AddTextBox(10, 50, 100, 30)
            textBox.Text = "Hello"

            Dim textBoxWithMaxLength As PdfTextBox = page.AddTextBox(10, 90, 100, 30)
            textBoxWithMaxLength.MaxLength = 5

            Dim passwordTextBox As PdfTextBox = page.AddTextBox(10, 130, 100, 30)
            passwordTextBox.Text = "Secret password"
            passwordTextBox.PasswordField = True

            Dim pathToFile As String = "TextFields.pdf"
            pdf.Save(pathToFile)
            pdf.Dispose()

            Process.Start(pathToFile)
        End Sub
    End Class
End Namespace