Author Topic: printer temlate help  (Read 18747 times)

fabos

  • Newbie
  • *
  • Posts: 2
printer temlate help
« on: February 21, 2012, 02:10:17 am »
hi,

I need some help for printer template.


my ticket ow is composed like this

(from left to right)
no. of products
product name
prioce (no. of products * price)

ie.
2 pizza xxxxx   30000
2 coke  10000

My need is:

all the prices should be  aligned to the right. I was not able to find any code to be inserted to do this.
Nw the prices just follow the product name and it is difficult to read the ticket .

anyone could suggest me how to do that?

thanks in advance


JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: printer temlate help
« Reply #1 on: February 21, 2012, 02:14:01 am »
Fabos,

In your printer template under Line Template use this

<J>{QUANTITY} {NAME}|  {TOTAL AMOUNT}

The <J> means Justify and the | splits the line left and right.

Some References
http://forum2.sambapos.org/index.php/topic,130.0.html
http://forum2.sambapos.org/index.php/topic,136.0.html
« Last Edit: February 21, 2012, 02:17:13 am by JohnSCS »
SambaPOS - POS'n the World, one Terminal at a time.

mozhi

  • Jr. Member
  • **
  • Posts: 71
Re: printer temlate help
« Reply #2 on: February 25, 2012, 09:42:18 am »
Hey John/Emre,

This is my samle Ticket Layout.

4-Flavors
Multicuisine Fine Dine Restaurant
Kasthuri Nagar
Bangalore
Ph:+91-9742274495TIN:ABCD1234
Date:25-02-2012Table No:B21
Time:21:03Ticket No:26
------------------------------------------
-Item Name RateQtyAmount
-Toast and Jam 1.50 1 1.50
-Bacon and Tomato 3.49 2 6.98
-Bacon and Cheese 3.49 2 6.98
==========================================

<J>VAT@14%: 2.16

Total: 17.62
******************************************
*Thank You for Dining With Us!!!*
******************************************

Note: I am using a pdf printer. If that is the cause, pls ignore the question, as i dont have a Ticket printer.
How do i configure the demo notepad printer. I tried configuring but I dont get it printed. pls provide Snapshot of printer configuration tab if possible.

My Question is I get Unnecessary lines when there is no Discount and No Gifts.
Is ther a way that these lines dont get printed  when the ticket doesn't have Discounts or Gifts .
I am

My Configuration is as follows:
<F>=
<EB>
<J10>[{IF DISCOUNT}]
<J10>[{SERVICE DETAILS}]
<J10>[Total Gift:|{GIFT TOTAL}]
<J10>Total:|{TICKET TOTAL}
{IF PAID}
<DB>
<F>*
<C10>*Thank You for Dining With Us!!!*
<F>*

Thanks in advance as usual..!!!

endrju

  • Business Group
  • Newbie
  • *****
  • Posts: 24
    • Gringo in Rio
Re: printer temlate help
« Reply #3 on: February 25, 2012, 12:23:57 pm »
Hey mozhi,
I think that in Ticket Template is a special line about Gifts. Put your line
<J10>[Total Gift:|{GIFT TOTAL}] there.

It should print your gift line only when it's selected.
Shit happens - no matter if you are in Rio or Europe - Gringo in Rio

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: printer temlate help
« Reply #4 on: February 25, 2012, 05:14:50 pm »
I'm not currently in front of my computer, so I can't comment on your configuration just yet.

But with printing, PDF is proportional printing and will not print properly.
Change to Demo Printer(notepad) an then open notepad up and leave running in the background. When you print a ticket, flick to notepad and you will see the receipt.
Note: notepad will only show one size of text, so large text will show as the same size as the rest of the ticket.

The best and only true way to testing printing formats with a receipt printer.

The square brackets [] mean don't print if no details, so make sure the [ is before <J10>
Service details is pre formatted, you don't need <J10>
« Last Edit: February 25, 2012, 05:28:03 pm by JohnSCS »
SambaPOS - POS'n the World, one Terminal at a time.

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: printer temlate help
« Reply #5 on: February 26, 2012, 01:20:54 am »
Mozhi,

Here is the footer template for my receipt printer template (photo of actual receipt attached)

<F>=
<EB>
[<J00>{IF DISCOUNT}]
[<J00>Total Gift|{GIFT TOTAL}]
{TAX DETAILS}
<J01>Total|${TICKET TOTAL}
<DB>
<J00>Tendered|${TICKETTAG:Tendered}
<J00>Change Due|${TICKETTAG:Change Due}
<F>=
<C10>T H A N K    Y O U

Tax Details & Service details are pre-formatted and do not require any format tags like <J>
Square brackets around a complete line means do not show if tag is empty (no value or 0)

When you play with the ticket tags you haven't used before, don't use any formatting, just test print, then apply formats as required to get the desired layout.

SambaPOS - POS'n the World, one Terminal at a time.

mozhi

  • Jr. Member
  • **
  • Posts: 71
Re: printer temlate help
« Reply #6 on: February 26, 2012, 02:58:07 am »
Thanks John.!! I got it this time

I think {if paid} is creating that prints.
Let me check it once.

mozhi

  • Jr. Member
  • **
  • Posts: 71
Re: printer temlate help
« Reply #7 on: February 28, 2012, 12:14:54 pm »
HI Emre/John,

I have a question about the printers.

I have a printer with the below mentioned specifications

"Character per Line: Font A- 48 columns; Font B-64 columns; Font C-72 columns [at 80 mm Paper width]
Character Set: Alphanumeric, International, PC 437 PC 850 / 852 / 857 / 858 / 860 / 863 / 864 / 865 / 866
Barcode Fonts: UPC-A/E, JAN(EAN) 13/8 columns, ITF, CODE 39, CODE 128, CODABAR (NW-7), CODE 93, PDF417, QR Code
"


Does it mean that I can  print 48 characters if i select A Font type, 64 for B and 72 for C if that is the case where should i make the settings for the same.

Is there a way in samba to automatically set font types especially in case of Item name too long to automatically rint in smaller font types.

 

 

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: printer temlate help
« Reply #8 on: February 28, 2012, 03:57:04 pm »
Mozhi,

SambaPOS uses the ESC/POS printer standard, so we never refer directly to Font A or Font B.

By default we usually print using Font A - 48 columns for an 80mm printer. Then by formatting tags we can increase the size by factors of 2, 3, 4, etc

For example
<J01>Total|${TICKET TOTAL}
The 01 in <J01> tells the printer to print at the standard height, but print twice as wide.

Now, most printers do allow you to set/change a default font size like Font B in your case, but that is outside the basic functions of SambaPOS. You need the <XCT> codes to do this or change the default settings in the printer itself. SambaPOS can not change the Font size on demand for long lines.
SambaPOS - POS'n the World, one Terminal at a time.

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: printer temlate help
« Reply #9 on: February 28, 2012, 07:37:30 pm »
Great explanation.. Thanks.
My test printer even does not support smaller sized fonts. I think this feature is printer specific.

mozhi

  • Jr. Member
  • **
  • Posts: 71
Re: printer temlate help
« Reply #10 on: February 28, 2012, 10:10:48 pm »
Thanks John

sukasem

  • Jr. Member
  • **
  • Posts: 68
Re: printer temlate help
« Reply #11 on: June 22, 2012, 11:26:12 pm »
Mozhi,

Here is the footer template for my receipt printer template (photo of actual receipt attached)

<F>=
<EB>
[<J00>{IF DISCOUNT}]
[<J00>Total Gift|{GIFT TOTAL}]
{TAX DETAILS}
<J01>Total|${TICKET TOTAL}
<DB>
<J00>Tendered|${TICKETTAG:Tendered}
<J00>Change Due|${TICKETTAG:Change Due}
<F>=
<C10>T H A N K    Y O U

Tax Details & Service details are pre-formatted and do not require any format tags like <J>
Square brackets around a complete line means do not show if tag is empty (no value or 0)

When you play with the ticket tags you haven't used before, don't use any formatting, just test print, then apply formats as required to get the desired layout.

Hi John,
Could you show Line Template as well, please?
I can't get them aligned when 2 digits quantity or when the price each line have more digits.
For Example:
Code: [Select]
1x Tea               1.25 1.25
10x Tea             1.25 12.50