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

Render PDF to device context using Visual Basic 6

Question

I am evaluating Quick PDF Library for use with a custom Visual Basic 6 application we're developing for one of our customers. Would you have any sample VB6 code (using either your ActiveX or DLL versions) that demonstrate how to render a PDF file to a device context or window handle? Any information you can provide would be appreciated.

Answer

This example uses DLL version of Quick PDF Library.

You need to add DLL reference and add module "QuickPDFDLL0718.bas" to your VB6 project.

Then use the following code:

Option Explicit

Dim LicenseKey
Dim FileName
Dim Result
Dim InstanceID

Private Sub Form_Load()
// Create QPL instacne
InstanceID = QuickPDFCreateLibrary()

// Enter License Key
LicenseKey = "......LicenceKey......."

// Select Input PDF File
FileName = "C:\input.pdf"

Result = QuickPDFUnlockKey(InstanceID, LicenseKey)

// Load PDF file in memory
Result = QuickPDFLoadFromFile(InstanceID, FileName)

// Render First page of input file to Device Context
Result = QuickPDFRenderPageToDC(InstanceID, 100, 1, hDC)

End Sub

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