Back to Blog

    Developer Blog

    Setup Visual Basic and Visual Studio with the DLL edition of Foxit Quick PDF Library

    Foxit Quick PDF Library

    Here are some instructions on how to use the DLL edition of Foxit Quick PDF Library with Visual Basic .NET within Visual Studio. This answer applies to Visual Studio 2003 through to Visual Studio 2013.

    To make life easier, the DLL edition of Foxit Quick PDF Library includes an import file for use with Visual Basic. This import file is generally located at if you chose to install Foxit Quick PDF Library in the default location:

    • C:\Program Files (x86)\Debenu\PDF Library\DLL\Import\VB.NET\DebenuPDFLibraryDLL1312.vb

    Add this import file to your Visual Basic solution by right-clicking on your solution in the Solution Explorer in Visual Studio and clicking on Add > Existing Item and then selecting the import file. You will then need to call the DebenuPDFLibraryDLL1312 namespace. This will require you to type your projects name and Foxit Quick PDF Library’s namespace. Remember spaces and dashes are replaced with underscores, so it might look something like this:

    private void Form1_Load(object sender, EventArgs e)
    Imports Hello_World_DLL_Edition.DebenuPDFLibraryDLL1312

    Once that’s done, you’re ready to initiate the library and start your work. Here’s a basic example of how to initiate the library and perform some basic operations:

    private void Form1_Load(object sender, EventArgs e)
    Imports Hello_World_DLL_Edition.DebenuPDFLibraryDLL1312
    
    Public Class Form1
    Dim DPL As PDFLibrary ' Declaring DPL here lets you access it from all subs
    
    Private Sub btnHelloWorld_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 
    Handles btnHelloWorld.Click
    
    Dim LicenseKey
    Dim Result
    
    DPL = New PDFLibrary("DebenuPDFLibraryDLL1312.dll") // 'Update path if necessary
    LicenseKey = "..." // 'Insert your trial or commercial license key here
    
    Result = DPL.UnlockKey(LicenseKey)
    If Result = 1 Then
    
    DPL.SetOrigin(1)
    DPL.DrawText(100, 100, "Hello Visual Basic! This text has been drawn using the DrawText 
    function.")
    DPL.SaveToFile("Hello_World.pdf")
    
    Else
    MsgBox("- Invalid license key -")
    End If
    DPL = Nothing
    End Sub
    End Class

    This article refers to a deprecated product. If you are looking for support for Foxit PDF SDK, please click here.