Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 1, 2022 22:13
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/6b114ec721cbec67cd6bd658d913e89a to your computer and use it in GitHub Desktop.
Save parzibyte/6b114ec721cbec67cd6bd658d913e89a to your computer and use it in GitHub Desktop.
async probarImpresion() {
if (!this.impresoraSeleccionada) {
return alert("Seleccione una impresora");
}
if (!this.mensaje) {
return alert("Escribe un mensaje");
}
const conector = new ConectorPluginV3();
conector
.Iniciar()
.EstablecerAlineacion(ConectorPluginV3.ALINEACION_CENTRO)
.EscribirTexto("Hola Angular desde parzibyte.me")
.Feed(1)
.EscribirTexto(this.mensaje)
.Feed(1)
.DescargarImagenDeInternetEImprimir("https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Angular_full_color_logo.svg/1200px-Angular_full_color_logo.svg.png", ConectorPluginV3.TAMAÑO_IMAGEN_NORMAL, 400)
.Iniciar()
.Feed(1);
const respuesta = await conector.imprimirEn(this.impresoraSeleccionada);
if (respuesta == true) {
console.log("Impresión correcta");
} else {
console.log("Error: " + respuesta);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment