How to fill PDF forms with VB?

Question:Is there a way to fill PDF forms and then save (flatten) them to PDF files from within VB? Which library would you recommend? Is there any application available on VeryPDF?

Answer: When you need to fill PDF forms and save (flatten) them to PDF files from within VB, maybe you can have a free trial of this software:VeryPDF PDF Form Filler OCX, by which you can also fill PDF forms items such as text, check box, radio button, combo box, list box fields, etc. And by the PDF Form Filler OCX software, you can call it from C#, VB .NET, MS Visual Basic, Borland Delphi, VBA (MS Office products such as Access) and C++ via COM, C and C++ via native C. More detail information could be viewed at software homepage. In the following part, let us check how to use this software.

Step 1. Free evaluating PDF Form Filler OCX

  • When downloading finishes, there will be a zip file. Please extract it to some folder then you can find the executable file and related elements.
  • There are also PDF Form Filler SDK version available. Please download the proper version according to your needs.

Step 1. Fill PDF form from VB.

  • By this ActiveX control software, you can fill, import, export, print, save and email the PDF forms easily.
  • When you need to flatten forms to normal PDF, please refer to the following parameters and information.
  • Description:
        Flatten the filled PDF file to a flattened PDF file.
    Return value:

        The filename of flattened PDF file.
    Parameters:
        strInPDFFile: input PDF file, NULL or "" parameter will flatten current opened PDF file.
        strOutPDFFile: output PDF file.

  • Here are some code templates of filling PDF form, please refer to the following code templates.
  • Private Sub ExportForm_Click()
    On Error GoTo cError
    OpenDialog.Filter = "FDF Files (*.FDF)|*.fdf|XML Files
    (*.XML)|*.xml"
    OpenDialog.ShowOpen
    If OpenDialog.FileName <> "" Then
    strExt = "fdf"

    If OpenDialog.FilterIndex = 2 Then
    strExt = "xml"
    End If

    Pdfformocx1.ExportFormData OpenDialog.FileName + "."
    + strExt, strExt
    End If
    cError:
    Beep
    End Sub
    Private Sub FlattenForm_Click()
    On Error GoTo cError
    OpenDialog.Filter = "PDF Files (*.PDF)|*.PDF
    OpenDialog.ShowOpen
    If OpenDialog.FileName <> "" Then
    Pdfformocx1.FlattenForms "", OpenDialog.FileName
    End If
    cError:
    Beep
    End Sub

    Private Sub ImportForm_Click()
       On Error GoTo cError
    OpenDialog.Filter = "FDF Files (*.FDF)|*.fdf|XML Files
    (*.XML)|*.xml"
    OpenDialog.ShowOpen
    If OpenDialog.FileName <> "" Then
    strExt = "fdf"
    If OpenDialog.FilterIndex = 2 Then
    strExt = "xml"
    End If
    Pdfformocx1.ImportFormData
    OpenDialog.FileName, strExt
    End If
    cError:
    Beep
    End Sub

By the code template, you can fill PDF form from VB code easily. Please check more information on user manual.  During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 5.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
How to fill PDF forms with VB?, 5.0 out of 10 based on 1 rating

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!