HTML receipt Order not display correctly

https://scontent.fpnh1-2.fna.fbcdn.net/v/t34.0-12/17409586_1195575027226085_1921485304_n.jpg?oh=78755b41734069e319230dd836d1b1eb&oe=58D4BDE3

This is HTML Print …As my try i still can not get the line of order have a correct position. Anyone who know the solution please help tell me how to make it to have a correct position. @JTRTech

Can you show your template please?

What are you trying to do. Can you edit the picture in paint and show what parts you want where

Why are you using HTML?
Guessing your refering to the qty, price and amount columns not being columns?
Guessing its your html code but without template we cant help much.
Also you have very large left mrgin… check your driver settings.

I think because some products are not in English.

If using V5 I would recommend just to use Document Printer instead, the formatting options are better, but I believe he is using V4 according to the topic category.

I use HTML because my product name is in unicode and my printer not support i try to fix ready but can not …so this why i try to use HTML instead …every thing seem work but the problem is i can not make a column of ordering item …HTML .pdf (185.6 KB)

You have removed formatting from the original template that broke how it should work. When using <J00> tag, you need to have columns separated by | otherwise there is no way for it to know what is a column.

So for a start, change this line

<J00>{NAME} {QUANTITY} [=FF('{PRICE}','#,#')] [=FF('{TOTAL PRICE}','#,#')]

to

<J00>{NAME}|{QUANTITY}|[=FF('{PRICE}','#,#')]|[=FF('{TOTAL PRICE}','#,#')]

And follow same for other similar lines using <J> tag.

You should also reduce the font size using HTML tags so you have more space to layout the receipt.

Unfortunately HTML printing support in V4 doesn’t have support for HTML <table> tag (support was added in V5.1.32). That would give you better support for handling columns.

You can read more about standard formatting tags (not necessarily for HTML format) here:

I try your way but the text still not align …it will be like this

បរបរសណ្ដែក 1 3000 3000
ស្ករ 1 2000 2000

it mean it not always be same position column when the name it short it left side and when the name of product is long it will long to the right side too…

any way to fix it or @emre please help me suggest the model of printer i should buy to replace my current one because i all my product is unicode and if i choose Ticket Printer it will show ???
event thought i try to set a character set to unicode it still like this it mean my printer not support …

It has nothing to do with the printer. It is all to do with your template. Like I said in my previous post, your template has many issues. I suggest you start with the default Ticket Template then set to HTML and modify, rather than what you have currently done.

I personally don’t use the HTML template anymore since I upgraded to V5 because the Document Printer in V5 has far better and controllable support when using unicode / non-English text.

If you want to try this way, you also need to update your printer to use the same character set as you select in SambaPOS. There will be some software that came with the printer that will allow you to set the character set, or some printer drivers have the option built in.

@Chhuy_Vannith I went back to an old V4 setup I did where I used HTML printer. Here are my templates, maybe you can use them as a starting point, but they may have some custom modifications you will need to remove. But at least the layout should work.

These are setup for a standard 80mm thermal receipt printer. I have the Line Character Count set to 45 on the printer settings in SambaPOS.

Some lines are set for supporting Chinese characters, which use double character spacing - you can see those tags that have :2 after them. Try like this first with your language, then try without the :2 and see what works best - it depends on the size used to print the non-English characters.

HTML Ticket Template

[LAYOUT]
-- General layout
<div style="font-family:NSimSun">
<div style="text-align:center">
<span style="font-weight:bold;font-size:30px;font-family:Arial"><C10>Company Name </span>
</div>
<div style="text-align:center;font-family:Arial">
<C00>Address 1
<C00:2>地址中文
<C00>Mon-Fri: 10:30–22:30  Sat-Sun: 11:00–23:00
<C00>Tel: 1234 5678
</div>
<div style="text-align:left">
<J00>Date/Time: {TICKET DATE} {TIME} | Ticket #: {TICKET NO}
{ENTITIES}
<F>-
{ORDERS}
<F>-
<EB>
{DISCOUNTS}
[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]
<J00>Total:|{TICKET TOTAL}
<DB>
<F>=
</div>
<div style="text-align:center;font-family:Arial">
<div style"font-size:15px;font-weight:bold"><C10>T H A N K   Y O U</div>
</div>
</div>

[DISCOUNTS]
<J00>{CALCULATION NAME} {CALCULATION AMOUNT}%|{CALCULATION TOTAL}

[DISCOUNTS:Tip]
<J00>{CALCULATION NAME} |{CALCULATION TOTAL}

[DISCOUNTS:Discount Value]
<J00>{CALCULATION NAME} |{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}|{TENDERED}

[ORDERS]
-- Default format for orders
<J00:2>{QUANTITY}x {NAME}|{TOTAL PRICE}
{ORDER TAGS}

[ORDERS:Gift]
-- Format for gifted orders
<J00:2>- {QUANTITY} {NAME}|**GIFT**
{ORDER TAGS}

[ORDERS:Void]
-- Nothing will print for void lines

[ORDER TAGS]
-- Format for order tags
<J00:2>  * {ORDER TAG NAME} | {ORDER TAG PRICE}

[ENTITIES:Table]
-- Table entity format
<J00>Table #: {ENTITY NAME} | [Guests: {TICKET TAG:Person Count}]

[ENTITIES:Customer]
-- Customer entity format
<J00:2>Customer: {ENTITY NAME}


[CHANGES]
-- Payment Change Format
Balance Amount: {CHANGE PAYMENT AMOUNT}

HTML Kitchen Orders Template

[LAYOUT]
<div style="font-family:NSimSun">
<div style="font-family:Arial;font-weight:bold;font-size:30px">
{ENTITIES}
</div>
<J00>{TICKET DATE} {TIME} | [Guests: {TICKET TAG:Person Count}] | Ticket #:{TICKET NO}
<F>-
<span style="font-size:20px">{ORDERS}
</span>
<F>=
</div>

[ORDERS]
<J00>{QUANTITY}x {NAME}
{ORDER TAGS}

[ORDERS:Void]
<J00>{QUANTITY}x {NAME}|**Void**
{ORDER TAGS}

[ORDER TAGS]
-- Format for order tags
<J00> * {ORDER TAG NAME}

[ENTITIES:Table]
-- Table entity format
<J00>TABLE: {ENTITY NAME}


[ENTITIES:Customer]
-- Customer entity format
<span style="font-size:15px">
<L00>Customer: {ENTITY NAME}
[<L00>Customer Tel: {ENTITY DATA:Phone}]
</span>

HTML Print Payment Bill

[LAYOUT]
-- General layout
<div style="font-family:NSimSun">
<div style="text-align:center">
<span style="font-weight:bold;font-size:30px;font-family:Arial"><C10>Company Name </span>
</div>
<div style="text-align:center;font-family:Arial">
<C00>Address 1
<C00:2>地址中文
<C00>Mon-Fri: 10:30–22:30  Sat-Sun: 11:00–23:00
<C00>Tel: 1234 5678
</div>
<div style="text-align:left">
<J00>Date/Time: {TICKET DATE} {TIME} | Ticket #: {TICKET NO}
{ENTITIES}
<F>-
{ORDERS}
<F>-
<EB>
{DISCOUNTS}
[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]
<J00>Total:|{TICKET TOTAL}
{PAYMENTS}
<J00>Change        |{CHANGE TOTAL}
{CHANGES}
<DB>
<F>=
</div>
<div style="text-align:center;font-family:Arial">
<div style"font-size:15px;font-weight:bold"><C10>T H A N K   Y O U</div>
</div>
</div>

[DISCOUNTS]
<J00>{CALCULATION NAME} {CALCULATION AMOUNT}%|{CALCULATION TOTAL}

[DISCOUNTS:Tip]
<J00>{CALCULATION NAME} |{CALCULATION TOTAL}

[DISCOUNTS:Discount Value]
<J00>{CALCULATION NAME} |{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}|{TENDERED}

[ORDERS]
-- Default format for orders
<J00:2>{QUANTITY}x {NAME}|{TOTAL PRICE}
{ORDER TAGS}

[ORDERS:Gift]
-- Format for gifted orders
<J00:2>- {QUANTITY} {NAME}|**GIFT**
{ORDER TAGS}

[ORDERS:Void]
-- Nothing will print for void lines

[ORDER TAGS]
-- Format for order tags
<J00:2>  * {ORDER TAG NAME} | {ORDER TAG PRICE}

[ENTITIES:Table]
-- Table entity format
<J00>Table #: {ENTITY NAME} | [Guests: {TICKET TAG:Person Count}]

[ENTITIES:Customer]
-- Customer entity format
<J00:2>Customer: {ENTITY NAME}


[CHANGES]
-- Payment Change Format
Balance Amount: {CHANGE PAYMENT AMOUNT}

i try copy and test your template ready …it also not correct align format
the total some time right side and some time go to a new line
https://scontent.fpnh1-2.fna.fbcdn.net/v/t34.0-12/17496111_1196338920483029_901820885_n.jpg?oh=04cf32f9ba12024e770a3d9e1b1e1a83&oe=58D64351

It’s to do with the length of the product name {NAME}. I think you didn’t remove :2 from the tag on that line? Try that and see if it works better.

You may also need to tweak the Line Character Count on your printer settings in SambaPOS.

Also like I said, this works for me, it doesn’t mean it will work for you just “as is”, you may need to tweak it slightly. But at least the overall layout is better now and I think with some tweaking you are almost there now.

i try ready buy still same…

Thank you all for support it maybe my printer not support . I use CODESOFT TP-3160LII
Can all of you let me know this one support or not ?

It’s not related to the printer. It is 100% related to the template or your setup.

I try many way ready and also follow your way …

  1. My product have name as khmer unicode format

after i try to follow you i get the good result but the problem is my receipt is show not in column


បរបរសណ្ដែក 1 3.00 3.00
បរបរសណ្ដែគក្រហម​​​​ 1 2.00 2.00


this mean the length of the product name is not same

J00:2{QUANTITY}x {NAME}|{TOTAL PRICE}

I would suggest you remove the <J00:2> and try using <J00> and check out the response

Yes i try it all out ready not yet correct …

Try using the new W tag to format columns, have a search in forum i cnt remember the exact post

V4 does not have <W:x> tag. Need v5.1.62 for that.

That does not help whatsoever. Supply more information as to what is not correct.

Show a screen shot of the physical print. Show a screen shot of the Printer Template. Copy and paste your Template into the Forum.

2 Likes