docs: Actualizar documentación TM-U220 con resultados de pruebas reales
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 36s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 36s
- Corregir caracteres por línea: Font A=33 (default), Font B=40 - Documentar que Font A es la fuente por defecto - Agregar charset completo soportado (box drawing, bloques, símbolos) - Documentar comandos que NO funcionan (textPosition, textSmooth, etc) - Corregir sintaxis de operaciones (textAlign, textStyle, feedLine) - Agregar nota: text NO tiene salto de línea automático - Crear resultados-pruebas-tmu220.md con todas las pruebas
This commit is contained in:
@@ -1,158 +1,231 @@
|
||||
# Guia de Impresion para Epson TM-U220
|
||||
# Guía de Impresión para Epson TM-U220
|
||||
|
||||
Esta guia documenta las mejores practicas para generar impresiones legibles en impresoras Epson TM-U220 usando el sistema printerCentral.
|
||||
Esta guía documenta las mejores prácticas para generar impresiones legibles en impresoras Epson TM-U220 usando el sistema printerCentral.
|
||||
|
||||
> **Nota:** Esta guía fue actualizada el 2025-11-26 basándose en pruebas reales con la impresora "Oficina Mami" (192.168.87.147).
|
||||
|
||||
## Especificaciones de la Impresora
|
||||
|
||||
| Caracteristica | Valor |
|
||||
| Característica | Font A | Font B |
|
||||
|----------------|--------|--------|
|
||||
| Columnas (normal) | 33 | 40 |
|
||||
| Columnas (doble ancho) | 16 | 20 |
|
||||
| Descripción | Normal | Condensada |
|
||||
|
||||
| Característica | Valor |
|
||||
|----------------|-------|
|
||||
| Columnas (Font A) | 40-42 caracteres |
|
||||
| Columnas (Font B) | 33-35 caracteres |
|
||||
| Columnas con doble ancho | ~20 caracteres |
|
||||
| Caracteres por pulgada | 17.8/16 cpi |
|
||||
| Ancho de papel | 57.5mm, 69.5mm, o 76mm |
|
||||
| Tipo | Matricial de impacto |
|
||||
|
||||
## Reglas Fundamentales
|
||||
|
||||
### 1. Limite de Caracteres por Linea
|
||||
## Caracteres por Línea (Resumen Rápido)
|
||||
|
||||
```
|
||||
Texto normal: max 40 caracteres
|
||||
Texto doble ancho: max 20 caracteres
|
||||
Texto doble alto: max 40 caracteres
|
||||
Texto doble ambos: max 20 caracteres
|
||||
Font A normal (1x1): 33 caracteres
|
||||
Font A doble ancho (2x1): 16 caracteres
|
||||
Font B normal (1x1): 40 caracteres
|
||||
Font B doble ancho (2x1): 20 caracteres
|
||||
```
|
||||
|
||||
### 2. Caracteres Soportados
|
||||
**Nota:** El doble alto (1x2) NO afecta la cantidad de caracteres horizontales.
|
||||
|
||||
**USAR** - Caracteres ASCII basicos:
|
||||
## Caracteres Soportados
|
||||
|
||||
### ✅ FUNCIONAN (todos probados)
|
||||
|
||||
**ASCII Básico:**
|
||||
```
|
||||
= - _ * + | / \ ( ) [ ] < >
|
||||
A-Z a-z 0-9
|
||||
= - , : . ; " ' [ ] { } ( ) / | \ * # @ $ % & ^ ~ ` _ + < >
|
||||
A-Z a-z 0-9 espacio
|
||||
```
|
||||
|
||||
**EVITAR** - Caracteres Unicode extendidos:
|
||||
**Box Drawing (para tablas):**
|
||||
```
|
||||
Líneas simples: ─ │ ┌ ┐ └ ┘
|
||||
Líneas dobles: ═ ║ ╔ ╗ ╚ ╝
|
||||
```
|
||||
|
||||
**Bloques (para gráficos ASCII):**
|
||||
```
|
||||
Sólido: █
|
||||
Medios: ▀ ▄
|
||||
Sombras: ░ ▒ ▓
|
||||
```
|
||||
|
||||
**Símbolos:**
|
||||
```
|
||||
Círculos: ● ○ ◘
|
||||
Flechas: ► ◄ ▲ ▼
|
||||
Cartas: ♠ ♣ ♥ ♦
|
||||
```
|
||||
|
||||
**Latino Extendido:**
|
||||
```
|
||||
Español: ñ á é í ó ú ¿ ¡
|
||||
Otros: ° ±
|
||||
```
|
||||
|
||||
### ❌ NO PROBADOS/EVITAR
|
||||
|
||||
```
|
||||
Box drawing: ╔ ═ ╗ ║ ╚ ╝ ┌ ┐ └ ┘
|
||||
Simbolos especiales: → ← ↑ ↓ ★ ● ○
|
||||
Emojis: cualquiera
|
||||
Caracteres asiáticos
|
||||
Símbolos muy especiales: → ← ↑ ↓ ★
|
||||
```
|
||||
|
||||
### 3. Espaciado con Feed
|
||||
## Operaciones Soportadas
|
||||
|
||||
Siempre usar `feed` para crear espacio visual. La impresora NO interpreta lineas vacias automaticamente.
|
||||
### Comandos que FUNCIONAN
|
||||
|
||||
```json
|
||||
{ "op": "feed", "lines": 1 } // Espacio simple
|
||||
{ "op": "feed", "lines": 2 } // Espacio entre secciones
|
||||
{ "op": "feed", "lines": 4 } // Espacio antes del corte
|
||||
```
|
||||
| Operación | Parámetros | Ejemplo |
|
||||
|-----------|------------|---------|
|
||||
| `text` | `value` | `{ "op": "text", "value": "Hola" }` |
|
||||
| `textAlign` | `align`: left, center, right | `{ "op": "textAlign", "align": "center" }` |
|
||||
| `textFont` | `font`: font_a, font_b | `{ "op": "textFont", "font": "font_a" }` |
|
||||
| `textSize` | `width`: 1-2, `height`: 1-2 | `{ "op": "textSize", "width": 2, "height": 1 }` |
|
||||
| `textStyle` | `em`, `ul` (booleans) | `{ "op": "textStyle", "em": true, "ul": true }` |
|
||||
| `textDouble` | `dw`, `dh` (booleans) | `{ "op": "textDouble", "dw": true }` |
|
||||
| `textRotate` | `rotate`: true/false | `{ "op": "textRotate", "rotate": true }` |
|
||||
| `textLineSpace` | `linespc`: número | `{ "op": "textLineSpace", "linespc": 50 }` |
|
||||
| `feedLine` | `line`: número | `{ "op": "feedLine", "line": 2 }` |
|
||||
| `feedUnit` | `unit`: número | `{ "op": "feedUnit", "unit": 50 }` |
|
||||
| `feed` | (ninguno) | `{ "op": "feed" }` |
|
||||
| `cut` | (ninguno, sin type) | `{ "op": "cut" }` |
|
||||
|
||||
### Comandos que NO FUNCIONAN
|
||||
|
||||
| Operación | Motivo |
|
||||
|-----------|--------|
|
||||
| `textPosition` | No soportado en TM-U220 |
|
||||
| `textVPosition` | No soportado en TM-U220 |
|
||||
| `textSmooth` | Sin efecto (es para térmicas) |
|
||||
| `textLang` | Sin efecto |
|
||||
| `textStyle.reverse` | No soportado |
|
||||
| `textStyle.color` | Solo color_1 (negro) funciona |
|
||||
| `textFont` font_c/d/e | No existen en TM-U220 |
|
||||
| `textSize` > 2 | Se trata como 2 |
|
||||
| `cut` con `type` | Genera SchemaError |
|
||||
| `barcode` | No soportado (matricial) |
|
||||
| `qrcode` | No soportado (matricial) |
|
||||
| `imageRaw` | No soportado (matricial) |
|
||||
|
||||
## Estructura Recomendada de un Ticket
|
||||
|
||||
### Header (Centrado, Destacado)
|
||||
|
||||
```json
|
||||
{ "op": "align", "align": "center" },
|
||||
{ "op": "style", "bold": true, "width": 2, "height": 2 },
|
||||
{ "op": "textAlign", "align": "center" },
|
||||
{ "op": "textSize", "width": 2, "height": 2 },
|
||||
{ "op": "textStyle", "em": true },
|
||||
{ "op": "text", "value": "TITULO" },
|
||||
{ "op": "style", "bold": false, "width": 1, "height": 1 },
|
||||
{ "op": "feed", "lines": 2 }
|
||||
{ "op": "textStyle", "em": false },
|
||||
{ "op": "textSize", "width": 1, "height": 1 },
|
||||
{ "op": "feedLine", "line": 2 }
|
||||
```
|
||||
|
||||
**Importante:** Con doble ancho solo caben 16 caracteres en Font A.
|
||||
|
||||
### Separadores
|
||||
|
||||
Siempre con feed antes y despues para que queden en su propia linea:
|
||||
Usar 33 caracteres `=` para Font A (o 40 para Font B):
|
||||
|
||||
```json
|
||||
{ "op": "text", "value": "================================" },
|
||||
{ "op": "feed", "lines": 1 }
|
||||
{ "op": "text", "value": "=================================" },
|
||||
{ "op": "feedLine", "line": 1 }
|
||||
```
|
||||
|
||||
Para 40 columnas usar 32 caracteres `=` (deja margen visual).
|
||||
|
||||
### Titulos de Seccion
|
||||
|
||||
Usar bold + underline, seguido de feed:
|
||||
### Títulos de Sección
|
||||
|
||||
```json
|
||||
{ "op": "style", "bold": true, "underline": true },
|
||||
{ "op": "textStyle", "em": true, "ul": true },
|
||||
{ "op": "text", "value": "NOMBRE SECCION" },
|
||||
{ "op": "style", "bold": false, "underline": false },
|
||||
{ "op": "feed", "lines": 1 }
|
||||
{ "op": "textStyle", "em": false, "ul": false },
|
||||
{ "op": "feedLine", "line": 1 }
|
||||
```
|
||||
|
||||
### Items de Lista
|
||||
|
||||
Cada item con su propio feed para legibilidad:
|
||||
|
||||
```json
|
||||
{ "op": "text", "value": "[ ] Item uno" },
|
||||
{ "op": "feed", "lines": 1 },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "[ ] Item dos" },
|
||||
{ "op": "feed", "lines": 1 }
|
||||
{ "op": "feedLine", "line": 1 }
|
||||
```
|
||||
|
||||
### Footer y Corte
|
||||
|
||||
```json
|
||||
{ "op": "align", "align": "center" },
|
||||
{ "op": "textAlign", "align": "center" },
|
||||
{ "op": "text", "value": "Texto de pie" },
|
||||
{ "op": "feed", "lines": 4 },
|
||||
{ "op": "feedLine", "line": 4 },
|
||||
{ "op": "cut" }
|
||||
```
|
||||
|
||||
## Ejemplo Completo: Lista de Compras
|
||||
## Ejemplo Completo
|
||||
|
||||
```json
|
||||
{
|
||||
"operations": [
|
||||
{ "op": "align", "align": "center" },
|
||||
{ "op": "style", "bold": true, "width": 2, "height": 2 },
|
||||
{ "op": "textAlign", "align": "center" },
|
||||
{ "op": "textSize", "width": 2, "height": 2 },
|
||||
{ "op": "textStyle", "em": true },
|
||||
{ "op": "text", "value": "MI TITULO" },
|
||||
{ "op": "style", "bold": false, "width": 1, "height": 1 },
|
||||
{ "op": "feed", "lines": 2 },
|
||||
{ "op": "textStyle", "em": false },
|
||||
{ "op": "textSize", "width": 1, "height": 1 },
|
||||
{ "op": "feedLine", "line": 2 },
|
||||
|
||||
{ "op": "text", "value": "================================" },
|
||||
{ "op": "feed", "lines": 1 },
|
||||
{ "op": "style", "bold": true },
|
||||
{ "op": "text", "value": "=================================" },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "textStyle", "em": true },
|
||||
{ "op": "text", "value": "SUBTITULO" },
|
||||
{ "op": "feed", "lines": 1 },
|
||||
{ "op": "style", "bold": false },
|
||||
{ "op": "text", "value": "================================" },
|
||||
{ "op": "feed", "lines": 2 },
|
||||
{ "op": "textStyle", "em": false },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "=================================" },
|
||||
{ "op": "feedLine", "line": 2 },
|
||||
|
||||
{ "op": "align", "align": "left" },
|
||||
{ "op": "style", "bold": true, "underline": true },
|
||||
{ "op": "textAlign", "align": "left" },
|
||||
{ "op": "textStyle", "em": true, "ul": true },
|
||||
{ "op": "text", "value": "SECCION 1" },
|
||||
{ "op": "style", "bold": false, "underline": false },
|
||||
{ "op": "feed", "lines": 1 },
|
||||
{ "op": "textStyle", "em": false, "ul": false },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "[ ] Item A" },
|
||||
{ "op": "feed", "lines": 1 },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "[ ] Item B" },
|
||||
{ "op": "feed", "lines": 2 },
|
||||
{ "op": "feedLine", "line": 2 },
|
||||
|
||||
{ "op": "align", "align": "center" },
|
||||
{ "op": "text", "value": "================================" },
|
||||
{ "op": "feed", "lines": 1 },
|
||||
{ "op": "textAlign", "align": "center" },
|
||||
{ "op": "text", "value": "=================================" },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "Pie de pagina" },
|
||||
{ "op": "feed", "lines": 4 },
|
||||
{ "op": "feedLine", "line": 4 },
|
||||
{ "op": "cut" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Operaciones Disponibles
|
||||
## Ejemplo con Box Drawing (Tabla)
|
||||
|
||||
| Operacion | Parametros | Ejemplo |
|
||||
|-----------|------------|---------|
|
||||
| `text` | `value` | `{ "op": "text", "value": "Hola" }` |
|
||||
| `feed` | `lines` | `{ "op": "feed", "lines": 2 }` |
|
||||
| `cut` | - | `{ "op": "cut" }` |
|
||||
| `align` | `align`: left, center, right | `{ "op": "align", "align": "center" }` |
|
||||
| `style` | `bold`, `underline`, `width`, `height` | `{ "op": "style", "bold": true }` |
|
||||
```json
|
||||
{
|
||||
"operations": [
|
||||
{ "op": "textFont", "font": "font_a" },
|
||||
{ "op": "text", "value": "╔═══════════════╦═══════════════╗" },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "║ PRODUCTO ║ PRECIO ║" },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "╠═══════════════╬═══════════════╣" },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "║ Cafe ║ $2.50 ║" },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "║ Pan ║ $1.00 ║" },
|
||||
{ "op": "feedLine", "line": 1 },
|
||||
{ "op": "text", "value": "╚═══════════════╩═══════════════╝" },
|
||||
{ "op": "feedLine", "line": 4 },
|
||||
{ "op": "cut" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Endpoints de Impresion
|
||||
## Endpoints de Impresión
|
||||
|
||||
### Imprimir Template Guardado
|
||||
|
||||
@@ -189,18 +262,20 @@ Sintaxis: `{{nombre}}` o `{{nombre:label:default}}`
|
||||
|
||||
## Errores Comunes
|
||||
|
||||
1. **Texto cortado o ilegible**: Excediste 40 caracteres por linea
|
||||
2. **Todo pegado**: Falta usar `feed` entre elementos
|
||||
3. **Caracteres raros**: Usaste Unicode no soportado
|
||||
4. **Separadores mezclados**: Falta `feed` antes/despues de lineas `===`
|
||||
5. **Header muy largo**: Con doble ancho solo caben ~20 chars
|
||||
1. **Texto cortado**: Excediste 33 caracteres (Font A) o 40 (Font B)
|
||||
2. **Todo pegado**: Falta `feedLine` entre elementos
|
||||
3. **SchemaError en cut**: Usaste `cut` con parámetro `type` (no soportado)
|
||||
4. **Header muy largo**: Con doble ancho solo caben 16 chars (Font A)
|
||||
5. **Colores no funcionan**: Solo funciona color_1 (negro)
|
||||
6. **Reverse no funciona**: No está soportado en TM-U220
|
||||
|
||||
## Checklist Pre-Impresion
|
||||
## Checklist Pre-Impresión
|
||||
|
||||
- [ ] Ninguna linea excede 40 caracteres (20 si doble ancho)
|
||||
- [ ] Solo caracteres ASCII basicos
|
||||
- [ ] `feed` entre cada item para legibilidad
|
||||
- [ ] `feed` antes y despues de separadores `===`
|
||||
- [ ] `feed: 4` antes del `cut` final
|
||||
- [ ] Header centrado con estilo destacado
|
||||
- [ ] Secciones con titulos bold+underline
|
||||
- [ ] Ninguna línea excede 33 caracteres (16 si doble ancho) en Font A
|
||||
- [ ] Ninguna línea excede 40 caracteres (20 si doble ancho) en Font B
|
||||
- [ ] `feedLine` entre cada elemento para legibilidad
|
||||
- [ ] `feedLine: 4` antes del `cut` final
|
||||
- [ ] Header centrado con estilo bold
|
||||
- [ ] Usando sintaxis correcta: `textAlign`, `textStyle`, `feedLine`
|
||||
- [ ] `cut` sin parámetro `type`
|
||||
- [ ] No usando: textPosition, textVPosition, textSmooth, textLang
|
||||
|
||||
Reference in New Issue
Block a user