Skip to content

Documents printing an Arabic receipt with khatt's receipt_image - #824

Open
DrEssam97 wants to merge 2 commits into
python-escpos:masterfrom
DrEssam97:docs/arabic-receipt-image
Open

DrEssam97 wants to merge 2 commits into
python-escpos:masterfrom
DrEssam97:docs/arabic-receipt-image

Conversation

@DrEssam97

Copy link
Copy Markdown
Contributor

Description

Updates the example in "Arabic, Persian and Urdu text" (added in #789). khatt now has receipt_image(), which lays out a whole receipt at the printer's width: (item, price) rows with the item on the right and the price on the left, a "---" divider, and a centered title and footer. It returns a 1-bit image that goes straight to image(), so the example no longer needs the font, alignment and background settings it had before.

The section also mentions that width takes "80mm" or "58mm", and that caption_image() still covers other layouts.

Disclosure: I maintain khatt.

Tested with

I have no printer here. I ran the example from the docs (khatt 0.10.0) against Dummy(profile="TM-T88V") and decoded the GS v 0 raster data it sends back into pixels. They match the receipt image exactly:

Decoded printer output

tox -e docs (HTML and spelling, both with -W) passes: run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.33%. Comparing base (0b3ceae) to head (3044c4a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #824   +/-   ##
=======================================
  Coverage   79.33%   79.33%           
=======================================
  Files          21       21           
  Lines        1742     1742           
  Branches      241      241           
=======================================
  Hits         1382     1382           
  Misses        282      282           
  Partials       78       78           
Flag Coverage Δ
unittests 79.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants