diQRcode 4.0.0
basQRcode.bas File Reference
The VBA/VB6 interface to diQRcode.dll.
- qrcodeCreateGif
- Create a GIF file of a QR code (deprecated). More...
- qrcodeCreateGifInUtf8
- Create a GIF file of a QR code, encoding input in UTF-8 (deprecated). More...
- qrcodeCreateImage
- Create an image file of a QR code. More...
- qrcodeCreateImageInUtf8
- Create a image file of a QR code, encoding input in UTF-8. More...
- qrcodeCreatePdf
- Create a PDF file of a QR code. More...
- qrcodeCreatePdfInUtf8
- Create a PDF file of a QR code, encoding input in UTF-8. More...
- qrcodeDllInfo
- Get information about the core native DLL. More...
- qrcodeErrorLookup
- Look up description for error code. More...
- QRCODE_Version
- Get version number of core DLL. More...
qrcodeCreateGif
Create a GIF file of a QR code (deprecated).
Syntax
[VBA]
Public Function qrcodeCreateGif ( _
szOutputFile As String, _
szInput As String, _
Optional nPixelsPerModule As Long = 0, _
Optional EccLevel As Ecc = Ecc.M, _
Optional szParams As String = "", _
Optional nOptions As Long = 0 _
) As Long
Parameters
- szOutputFile
- Name of output GIF file to be created.
- szInput
- Text input to be encoded (ANSI characters only).
- nPixelsPerModule
- Number of pixels per module (default = 2 ppm)
- EccLevel
- Error correction level Ecc (default = Ecc.M)
- szParams
- Optional parameters. Set as
"margin=N"
to change the margin to N
modules (default=4).
- nOptions
- Option flags. Set as
QRCODE_ESCAPED
to indicate #-escaped sequences in string.
Return Value
qrcodeCreateGifInUtf8
Create a GIF file of a QR code, encoding input in UTF-8 (deprecated).
Syntax
[VBA]
Public Function qrcodeCreateGifInUtf8 ( _
szOutputFile As String, _
szInput As String, _
Optional nPixelsPerModule As Long = 0, _
Optional EccLevel As Ecc = Ecc.M, _
Optional szParams As String = "", _
Optional nOptions As Long = 0 _
) As Long
Parameters
- szOutputFile
- Name of output GIF file to be created.
- szInput
- Text input to be encoded.
- nPixelsPerModule
- Number of pixels per module (default = 2 ppm)
- EccLevel
- Error correction level Ecc (default = Ecc.M)
- szParams
- Optional parameters. Set as
"margin=N"
to change the margin to N
modules (default=4).
- nOptions
- Option flags. Set as 0 for default.
Return Value
Remarks
Any non-ASCII characters in szInput
will be encoded in UTF-8 before processing.
qrcodeCreateImage
Create an image file of a QR code.
Syntax
[VBA]
Public Function qrcodeCreateImage ( _
szOutputFile As String, _
szInput As String, _
Optional imgType As ImageType = ImageType.GIF, _
Optional nPixelsPerModule As Long = 0, _
Optional nMargin As Long = 0, _
Optional EccLevel As Ecc = Ecc.M, _
Optional nOptions As Long = 0 _
) As Long
Parameters
- szOutputFile
- Name of output image file to be created.
- szInput
- Text input to be encoded (ANSI characters only).
- imgType
- Image type ImageType (default = ImageType.GIF)
- nPixelsPerModule
- Number of pixels per module (default = 2 ppm)
- nMargin
- Size of margin in modules (default = 4 modules)
- EccLevel
- Error correction level Ecc (default = Ecc.M)
- nOptions
- Option flags. Use the
Or
operator to combine:
QRCODE_ESCAPED
to indicate #-escaped sequences in string
QRCODE_BASE64
to encode output as base64 text
QRCODE_NO_NAMECHECK
do not check filename extension against file type
Return Value
qrcodeCreateImageInUtf8
Create a image file of a QR code, encoding input in UTF-8.
Syntax
[VBA]
Public Function qrcodeCreateImageInUtf8 ( _
szOutputFile As String, _
szInput As String, _
Optional imgType As ImageType = ImageType.GIF, _
Optional nPixelsPerModule As Long = 0, _
Optional nMargin As Long = 0, _
Optional EccLevel As Ecc = Ecc.M, _
Optional nOptions As Long = 0 _
) As Long
Parameters
- szOutputFile
- Name of output image file to be created.
- szInput
- Text input to be encoded.
- imgType
- Image type ImageType (default = ImageType.GIF)
- nPixelsPerModule
- Number of pixels per module (default = 2 ppm)
- nMargin
- Size of margin in modules (default = 4 modules)
- EccLevel
- Error correction level Ecc (default = Ecc.M)
- nOptions
- Option flags. Use the
Or
operator to combine:
QRCODE_ESCAPED
to indicate #-escaped sequences in string
QRCODE_BASE64
to encode output as base64 text
QRCODE_NO_NAMECHECK
do not check filename extension against file type
Return Value
qrcodeCreatePdf
Create a PDF file of a QR code.
Syntax
[VBA]
Public Function qrcodeCreatePdf ( _
szOutputFile As String, _
szInput As String, _
Optional nPixelsPerModule As Long = 0, _
Optional EccLevel As Ecc = Ecc.M, _
Optional nPageWidth As Long = 0, _
Optional nPageHeight As Long = 0, _
Optional nX As Long = 0, _
Optional nY As Long = 0, _
Optional nOptions As Long = 0 _
) As Long
Parameters
- szOutputFile
- Name of output PDF file to be created.
- szInput
- Text input to be encoded (ANSI characters only).
- nPixelsPerModule
- Number of pixels per module (default = 2 ppm)
- EccLevel
- Error correction level Ecc (default = Ecc.M)
- nPageWidth
- Width of PDF page in pixels (default = 0 : set width to fit QRcode image).
- nPageHeight
- Height of PDF page in pixels (default = 0 : set height to fit QRcode image).
- nX
- X-coordinate in pixels of bottom-left of QRcode image (default = 0 : at left side).
- nY
- Y-coordinate in pixels of bottom-left of QRcode image (default = 0 : at bottom).
- nOptions
- Option flags. Set as
QRCODE_ESCAPED
to indicate #-escaped sequences in string.
Return Value
qrcodeCreatePdfInUtf8
Create a PDF file of a QR code, encoding input in UTF-8.
Syntax
[VBA]
Public Function qrcodeCreatePdfInUtf8 ( _
szOutputFile As String, _
szInput As String, _
Optional nPixelsPerModule As Long = 0, _
Optional EccLevel As Ecc = Ecc.M, _
Optional nPageWidth As Long = 0, _
Optional nPageHeight As Long = 0, _
Optional nX As Long = 0, _
Optional nY As Long = 0, _
Optional nOptions As Long = 0 _
) As Long
Parameters
- szOutputFile
- Name of output PDF file to be created.
- szInput
- Text input to be encoded.
- nPixelsPerModule
- Number of pixels per module (default = 2 ppm)
- EccLevel
- Error correction level Ecc (default = Ecc.M)
- nPageWidth
- Width of PDF page in pixels (default = 0 : set width to fit QRcode image).
- nPageHeight
- Height of PDF page in pixels (default = 0 : set height to fit QRcode image).
- nX
- X-coordinate in pixels of bottom-left of QRcode image (default = 0 : at left side).
- nY
- Y-coordinate in pixels of bottom-left of QRcode image (default = 0 : at bottom).
- nOptions
- Option flags. Set as 0 for default.
Return Value
Remarks
Any non-ASCII characters in szInput
will be encoded in UTF-8 before processing.
qrcodeDllInfo
Get information about the core native DLL.
Syntax
[VBA]
Public Function qrcodeDllInfo ( _
Optional nOptions As Long = 0 _
) As String
Parameters
- nOptions
- For future use.
Return Value
String: Information about the core DLL module.
Remarks
Example result.
The attribute
Platform
is the platform the core DLL was compiled for:
Win32
or
X64
.
"Platform=Win32; Compiled=Mar 27 2021 03:50:03; Licence=T"
qrcodeErrorLookup
Look up description for error code.
Syntax
[VBA]
Public Function qrcodeErrorLookup ( _
nErrCode As Long _
) As String
Parameters
- nErrCode
- Value of error code to lookup (may be positive or negative).
Return Value
String: Error message, or empty string if no corresponding error code.
QRCODE_Version
Get version number of core DLL.
Syntax
[VBA]
Public Declare Function QRCODE_Version() As Long
Return Value
Long: Version number as an integer in form Major*10000 + Minor*100 + Release
. For example, version 2.10.3 would return 21003.
Remarks
[This function is an external procedure in library diQRcode.dll
.]
Enum Ecc
Error-correction code
Syntax
[VBA]
Public Enum Ecc
Members
| Member name | Description |
| M | EC level M (default) |
| L | EC level L |
| Q | EC level Q |
| H | EC level H |
Enum ImageType
Image type
Syntax
[VBA]
Public Enum ImageType
Members
| Member name | Description |
| GIF | Output image as a GIF file (default) |
| SVG | Output image as an SVG file |