Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 14, 2022 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/5e96853b59776f5f239930c34732de7e to your computer and use it in GitHub Desktop.
Save parzibyte/5e96853b59776f5f239930c34732de7e to your computer and use it in GitHub Desktop.
const imprimirHolaMundo = async (nombreImpresora) => {
const mensaje = $mensaje.value;
const url = $url.value;
if (!mensaje) {
return alert("Escribe un mensaje");
}
if (!url) {
return alert("Escribe la URL");
}
const conector = new ConectorPluginV3(URLPlugin);
conector.Iniciar();
conector.EscribirTexto(mensaje);
conector.Feed(1);
const respuesta = await conector
.imprimirEnImpresoraRemota(nombreImpresora, url + "/imprimir");
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