Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Using Visual Basic and the DLL edition of Quick PDF Library

Question

Can you provide some sample code showing how the DLL edition of Quick PDF Library can be used with Visual Basic within Visual Studio?

Answer

Certainly, here are some instructions on how to use the DLL edition of Quick PDF Library with Visual Basic .NET within Visual Studio. This answer applies to Visual Studio 2003 through to Visual Studio 2010.

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

C:\Program Files\Quick PDF Library\DLL\Import\Visual Basic\QuickPDFDLL0718.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 QuickPDFDLL0718 namespace. This will require you to type your solutions name and QPL's namespace. Remember spaces and dashes are replaced with underscores, so it might look something like this:

Imports Hello_World___DLL_Edition.QuickPDFDLL0718

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:

Imports Hello_World___DLL_Edition.QuickPDFDLL0718

Public Class Form1

Private Sub btnHelloWorld_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 
Handles btnHelloWorld.Click

Dim QP As PDFLibrary
Dim LicenseKey
Dim Result

QP = New PDFLibrary("QuickPDFDLL0718.dll") //'Update path if necessary
LicenseKey = "..." //'Insert your trial or commercial license key here

Result = QP.UnlockKey(LicenseKey)
If Result = 1 Then

QP.SetOrigin(1)
QP.DrawText(100, 100, "Hello Visual Basic! This text has been drawn using the DrawText 
function.")
QP.SaveToFile("Hello_World.pdf")

Else
MsgBox("- Invalid license key -")
End If
QP = Nothing
End Sub
End Class

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum