Want to speed up the application development? Then this VB.NET, code samples for VB.NET, developers help to speed up the application development and writing a code when using ByteScout PDF Suite. To use fill form w 9 with pdf sdk in your VB.NET project or application just copy & paste the code and then run your app! This basic programming language sample code for VB.NET will do the whole work for you in implementing fill form w 9 with pdf sdk in your app.
On our website you may get trial version of ByteScout PDF Suite for free. Source code samples are included to help you with your VB.NET application.
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to fill PDF form programmatically. ''' </summary> Class Program Shared Sub Main() ' Map of form fields and sample values to set Dim fieldMap As New Dictionary(Of String, Object)() fieldMap.Add("f1_1", "John J Smith") ' Name fieldMap.Add("f1_2", "12 Palm st., Hill Valley, CA 12345") ' Business address ' Load PDF form Dim pdfDocument = New Document("W-9.pdf") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" ' Get first page Dim page = pdfDocument.Pages(0) ' Get widget by its name and change value For Each keyValuePair In fieldMap Dim annotation As Annotation = page.Annotations(keyValuePair.Key) If TypeOf (annotation) Is CheckBox Then CType(annotation, CheckBox).Checked = CType(keyValuePair.Value, Boolean) ElseIf TypeOf (annotation) Is EditBox Then CType(annotation, EditBox).Text = CType(keyValuePair.Value, String) End If Next ' Save modified document pdfDocument.Save("result.pdf") ' Cleanup pdfDocument.Dispose() ' Open document in default PDF viewer app Process.Start("result.pdf") End Sub End Class