Public Sub WriteQRCode(size As Int, EC As String, scale As Int, data As String)
Dim databytes() As Byte = data.GetBytes("ISO-8859-1")
Dim dhigh As Int = databytes.Length / 256
Dim dlow As Int = databytes.Length - dhigh*256
Log("QR Code : Size " & size & ", EC " & EC & ", Scale " & scale & ", Size " & dlow & " " & dhigh & " : Data = " & data)
Dim params(3) As Byte
params(0) = scale
params(1) = dlow
params(2) = dhigh
WriteString(ESC & "Z" & Chr(size) & EC.ToUpperCase.CharAt(0))
WriteBytes(params)
WriteBytes(databytes)
End Sub