Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active October 1, 2022 03:54
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/3577ced77733f84c72f8732e71f6fc4e to your computer and use it in GitHub Desktop.
Save parzibyte/3577ced77733f84c72f8732e71f6fc4e to your computer and use it in GitHub Desktop.
const amongUsComoCadena = `000001111000
000010000100
000100011110
000100100001
011100100001
010100100001
010100100001
010100011110
010100000010
011100000010
000100111010
000100101010
000111101110
000000000000
000000000000
000000000000
111010101110
100010101000
111010101110
001010100010
111011101110
000000000000
000000000000
000000000000`;
const conector = new ConectorPluginV3();
const respuesta = await conector
.Iniciar()
.DeshabilitarElModoDeCaracteresChinos()
.EstablecerAlineacion(ConectorPluginV3.ALINEACION_CENTRO)
.DescargarImagenDeInternetEImprimir("http://assets.stickpng.com/thumbs/587e32259686194a55adab73.png", 0, 216)
.Feed(1)
.EscribirTexto("Parzibyte's blog\n")
.EscribirTexto("Blog de un programador\n")
.TextoSegunPaginaDeCodigos(2, "cp850", "Teléfono: 123456798\n")
.EscribirTexto("Fecha y hora: " + (new Intl.DateTimeFormat("es-MX").format(new Date())))
.Feed(1)
.EstablecerAlineacion(ConectorPluginV3.ALINEACION_IZQUIERDA)
.EscribirTexto("____________________\n")
.TextoSegunPaginaDeCodigos(2, "cp850", "Venta de plugin para impresoras versión 3\n")
.EstablecerAlineacion(ConectorPluginV3.ALINEACION_DERECHA)
.EscribirTexto("$25\n")
.EscribirTexto("____________________\n")
.EscribirTexto("TOTAL: $25\n")
.EscribirTexto("____________________\n")
.EstablecerAlineacion(ConectorPluginV3.ALINEACION_CENTRO)
.HabilitarCaracteresPersonalizados()
.DefinirCaracterPersonalizado("$", amongUsComoCadena)
.EscribirTexto("En lugar del simbolo de pesos debe aparecer un among us\n")
.EscribirTexto("TOTAL: $25\n")
.EstablecerEnfatizado(true)
.EstablecerTamañoFuente(1, 1)
.TextoSegunPaginaDeCodigos(2, "cp850", "¡Gracias por su compra!\n")
.Feed(1)
.ImprimirCodigoQr("https://parzibyte.me/blog", 160, ConectorPluginV3.RECUPERACION_QR_MEJOR, ConectorPluginV3.TAMAÑO_IMAGEN_NORMAL)
.Feed(1)
.ImprimirCodigoDeBarrasCode128("parzibyte.me", 80, 192, ConectorPluginV3.TAMAÑO_IMAGEN_NORMAL)
.Feed(1)
.EstablecerTamañoFuente(1, 1)
.EscribirTexto("parzibyte.me\n")
.Feed(3)
.Corte(1)
.Pulso(48, 60, 120)
.imprimirEn("ZJ-58");
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