ByteScout PDF SDK – VB.NET – Read Form Values from 1099-INT form

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VB.NET – Read Form Values from 1099-INT form

ByteScout PDF SDK – VB.NET – Read Form Values from 1099-INT form

Program.vb

Imports Bytescout.PDF

''' <summary>
''' This example demonstrates how to get PDF form values programmatically.
''' </summary>
Class Program

    Shared Sub Main()

        ' Load PDF form
        Dim pdfDocument = New Document("f1099int_filled.pdf")
        pdfDocument.RegistrationName = "demo"
		pdfDocument.RegistrationKey = "demo"

        ' Read from second page
        Dim page = pdfDocument.Pages(1)


        Console.WriteLine("F1099int_filled Form values are as follows")

        ' Is Void
        Dim lIsVoid = DirectCast(page.Annotations("c2_1[0]"), CheckBox).Checked
        Console.WriteLine($"Is Void: {lIsVoid}")

        ' Payer's info
        Dim cPayerInfo = DirectCast(page.Annotations("f2_1[0]"), EditBox).Text
        Console.WriteLine($"Payer Info: {cPayerInfo}")

        ' Payer's TIN
        Dim cPayerTin = DirectCast(page.Annotations("f2_2[0]"), EditBox).Text
        Console.WriteLine($"Payer TIN: {cPayerTin}")

        ' Recipient's TIN
        Dim cRecipientTin = DirectCast(page.Annotations("f2_4[0]"), EditBox).Text
        Console.WriteLine($"Recipient TIN: {cRecipientTin}")

        ' Street Address 1
        Dim cStreetAddress1 = DirectCast(page.Annotations("f2_5[0]"), EditBox).Text
        Console.WriteLine($"Street Address - 1: {cStreetAddress1}")

        ' Street Address 2
        Dim cStreetAddress2 = DirectCast(page.Annotations("f2_6[0]"), EditBox).Text
        Console.WriteLine($"Street Address - 2: {cStreetAddress2}")

        ' Cleanup 
        pdfDocument.Dispose()

        Console.WriteLine()
        Console.WriteLine("Press any key to exit....")
        Console.ReadLine()

    End Sub

End Class


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next