Last active
July 5, 2023 01:50
-
-
Save parzibyte/4bf2afd166685a07b5e7b10dfeb775c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const imprimirQr = async (nombreImpresora) => { | |
const contenido = "Soy el contenido de un QR. Visita parzibyte.me"; | |
if (!contenido) { | |
return alert("Escribe el contenido del QR"); | |
} | |
const conector = new ConectorPluginV3(URLPlugin); | |
conector.Iniciar(); | |
conector.EscribirTexto("Veamos un QR:"); | |
conector.Feed(1); | |
conector.ImprimirCodigoQr(contenido, 160, 2, ConectorPluginV3.TAMAÑO_IMAGEN_NORMAL); | |
conector.Iniciar(); //Nota: esto solo es necesario en ocasiones, por ejemplo en mi impresora debo hacerlo siempre que acabo de imprimir una imagen | |
conector.Feed(1); | |
const respuesta = await conector | |
.imprimirEn(nombreImpresora); | |
if (respuesta === true) { | |
alert("Impreso correctamente"); | |
} else { | |
alert("Error: " + respuesta); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment