Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 19, 2019 17:02
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/d924ec3a9549bb70c6009ed2dff2a7cb to your computer and use it in GitHub Desktop.
Save parzibyte/d924ec3a9549bb70c6009ed2dff2a7cb to your computer and use it in GitHub Desktop.
/**
* Ejemplos de uso de JsBarcode
*
* @author parzibyte
*
* https://parzibyte.me/blog
*/
JsBarcode(".codigo")
.options({
format: "CODE128",// El formato
width: 2, // La anchura de cada barra
height: 30, // La altura del código
displayValue: true, // ¿Mostrar el valor (como texto) del código de barras?
text: "Hola", // Texto (no código) que acompaña al barcode
fontOptions: "bold", // Opciones de la fuente del texto del barcode
textAlign: "left", // En dónde poner el texto. center, left o right
textPosition: "top", // Poner el texto arriba (top) o abajo (bottom)
textMargin: 10, // Margen entre el texto y el código de barras
fontSize: 8, // Tamaño de la fuente
background: "#8bc34a", // Color de fondo
lineColor: "#FF0000", // Color de cada barra
marginTop: 10, // Margen superior
marginRight: 10, // Margen derecho
marginBottom: 5, // Margen inferior
marginLeft: 35, // Margen izquierdo
})
.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment