-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathACBrPosPrinter.py
More file actions
37 lines (18 loc) · 762 Bytes
/
ACBrPosPrinter.py
File metadata and controls
37 lines (18 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import ctypes
# AQUI VC COLOCAR CAMINHO DA DLL
acbr_lib = ctypes.CDLL(r'C:\ACBrLibPosPrinterPython\ACBrPosPrinter64.dll')
# AQUI VC COLOCAR CAMINHO DO ARQUIVO INI
acbr_lib.POS_Inicializar(r'C:\ACBrLibPosPrinterPython\ACBrLIB.ini'.encode("utf-8"), "".encode("utf-8"))
texto = f"""</ce><qrcode>www.google.com</qrcode>
OLÁ ESTA É UMA MENSAGEM DE TESTE
COMPREENDIDO ESTOU TESTANDO!
"""
acbr_lib.POS_Ativar()
eString = ctypes.create_string_buffer(len(texto))
ctypes.memmove(eString, texto.encode('utf-8'), len(texto))
Copias = 1
acbr_lib.POS_InicializarPos()
acbr_lib.POS_Imprimir(eString, True, True, True, Copias)
acbr_lib.POS_CortarPapel(False)
acbr_lib.POS_Desativar()
acbr_lib.POS_Finalizar()