Legacy Knowledge Base
12216: Directing Users to Your Facebook Profile via a QRCode Generated by Toolkit
 
ProductVersionEnvironment
Toolkit Std
Toolkit Pro
2011
VBS
 
Description
 
Quick Download:

QRCodes are barcodes that can be read by a mobile phone equipped with a camera and a scanner application, and they let you direct potential customers from all walks of life to specific URLs.

Toolkit 2011 has an updated barcode library with support for QRCodes (Symbology 79). Using the APToolkit.Barcode object’s Symbology property and setting the value to 79 creates a QRCode.

The following example generates a QRCode in an output PDF file called QRCodeFBExample.PDF. When scanned, the barcode directs you to activePDF’s Facebook profile page.

strPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") & "\"

Set TK = CreateObject("APToolkit.Object")
Set barcode = CreateObject("APToolkit.Barcode")

barcode.Symbology = 79
barcode.BorderStyle = 0
barcode.SymbolMarginBottom = 0
barcode.SymbolMarginTop = 0
barcode.SymbolMarginRight = 0
barcode.SymbolMarginLeft = 0
barcode.Value = "http://facebook.com/pages/activePDF/116044711747600"

varReturn = TK.OpenOutputFile("QRCodeFBExample.pdf")
If varReturn <> 0 Then Error("OpenOutputFile"End If

r = TK.PrintImage(barcode.AsString, 100, 500, 100, 100, True, 0)

TK.CloseOutputFile

Set barcode = Nothing
Set TK = Nothing

' Done
Msgbox "Success!"

' Error Handling
Sub Error(Method)
    Msgbox "'" & Method & "' failed with a '" & varReturn
    Set TK = Nothing
    Wscript.Quit
End Sub
 
 
Keywords
 
facebook, qrcode, url, barcode, symbology 79, toolkit, social media
Copyright © 2001-2011 activePDF, Inc.