How to Start Convert PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

PDF Form VB.NET Library
How to Insert, Delete and Update Field in VB.NET


How to Insert, Delete and Update Fields in PDF Document with VB.NET Demo Code









Look for HTML5 PDF Editor?

EdgePDF: ASP.NET PDF Editor is the best HTML5 PDF Editor and ASP.NET PDF Viewer based on XDoc.PDF, JQuery, HTML5. It supports ASP.NET MVC and WebForms projects.


Overview



Field inserting, deletion and update is the most basic field edit function. By using RaterEdge .NET PDF package, you can add form fields to existing pdf files, delete or remove form field in PDF page and update PDF field in VB.NET application. VB.NET sample codes are provided below to help you finish these task.

asp.net add text to pdf field, mvc 5 display pdf in view, asp.net core pdf editor, best pdf preview in asp net c#, asp.net tif viewer, how to upload pdf file in database using asp.net c#, asp.net image thumbnail viewer.




VB.NET DLLs: Insert, Delete and Update Field





VB.NET Demo Code: Add Form Fields to an Existing PDF File



The demo code below can help you to add form fields to PDF file in VB.NET class




Dim inputFilePath As String = Program.RootPath + "\\" + "empty.pdf"
Dim outputFilePath As String = Program.RootPath + "\\" + "Output.pdf"

Dim fields As List(Of BaseFormField) = New List(Of BaseFormField)

' add a radio button field with default setting
Dim field1 As AFRadioButton = New AFRadioButton("AF_RadioButton_01")
field1.PageIndex = 0
field1.Position = New PointF(100.0F, 100.0F)
fields.Add(field1)

' add a checkbox field with default setting
Dim field2 As AFCheckBox = New AFCheckBox("AF_CheckBox_01")
field2.PageIndex = 0
field2.Position = New PointF(300.0F, 100.0F)
fields.Add(field2)

' add a checkbox field with default setting
Dim field3 As AFTextBox = New AFTextBox("AF_TextBox_01")
field3.PageIndex = 0
field3.Position = New PointF(100.0F, 300.0F)
fields.Add(field3)

' add a list box field with default setting
Dim field4 As AFListBox = New AFListBox("AF_ListBox_01")
field4.PageIndex = 0
field4.Position = New PointF(100.0F, 500.0F)
field4.Items = New String() {"Item 1", "Item 2", "Item 3", "Item 4"}
fields.Add(field4)

' add a combo box field with default setting
Dim field5 As AFComboBox = New AFComboBox("AF_ComboBox_01")
field5.PageIndex = 0
field5.Position = New PointF(300.0F, 500.0F)
field5.Items = New String() {"Item 1", "Item 2", "Item 3", "Item 4"}
fields.Add(field5)

' add a button field with default setting
Dim field6 As AFButton = New AFButton("AF_Button_01")
field6.PageIndex = 0
field6.Position = New PointF(100.0F, 700.0F)
fields.Add(field6)

' add fields to the input file
PDFFormHandler.AddFormFields(inputFilePath, fields, outputFilePath)





VB.NET Demo Code: Delete a Form Field in PDF Page



This is VB.NET sample code for deleting PDF document form field.




Dim inputFilePath As String = Program.RootPath + "\\" + "1_AF.pdf"
Dim outputFilePath As String = Program.RootPath + "\\" + "output.pdf"

' remove a field by name and output the new document
Dim fieldName As String = "AF_RadioButton_01"
Dim errCode As Integer = PDFFormHandler.RemoveFormField(inputFilePath, fieldName, outputFilePath)
If errCode = 0 Then
    Console.WriteLine("Success")
Else
    Console.WriteLine("Failed")
End If