feat: ESC/POS QR 비트맵 인쇄 활성화 (텍스트 검증 완료)

- QR 비트맵 인쇄 재활성화 (image_to_raster_esc_star)
- 에러 처리 강화: traceback 출력으로 디버깅 정보 제공
- QR 실패 시 URL 텍스트로 자동 폴백
- 텍스트 인쇄 검증 완료 (청춘약국, 거래정보, 금액 등)

ESC * 방식 (24-dot double-density) 사용

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
시골약사 2026-01-29 20:06:16 +09:00
parent 9a24c8659f
commit f4f7e8b1b4

View File

@ -69,9 +69,21 @@ def print_qr_receipt_escpos(qr_url, transaction_id, total_amount,
commands.append("================================\n".encode('euc-kr')) commands.append("================================\n".encode('euc-kr'))
commands.append("\n".encode('euc-kr')) commands.append("\n".encode('euc-kr'))
# 3. QR 코드 인쇄 (일단 URL 텍스트로만) # 3. QR 코드 인쇄 (비트맵 시도)
commands.append("QR 코드:\n".encode('euc-kr')) try:
commands.append(f"{qr_url}\n".encode('euc-kr')) print(f"[ESC/POS] QR 비트맵 변환 시작...")
qr_bitmap = image_to_raster_esc_star(qr_image)
commands.append(qr_bitmap)
commands.append(b"\n")
print(f"[ESC/POS] QR 비트맵 변환 완료 (ESC *)")
except Exception as e:
print(f"[ESC/POS] QR 비트맵 변환 실패: {e}")
import traceback
traceback.print_exc()
# QR 실패 시 URL 텍스트로 대체
commands.append("QR 코드:\n".encode('euc-kr'))
commands.append(f"{qr_url}\n".encode('euc-kr'))
commands.append("\n".encode('euc-kr')) commands.append("\n".encode('euc-kr'))
# 안내 문구 (폰트 명령어 제거) # 안내 문구 (폰트 명령어 제거)