Justified printer formatting

I’ve noticed something for a while that hasn’t been too much of an issue until now - using the <J00> printer formatting tag for 3 columns. I have an extreme example here, this is part of my receipt template:

<F>-
<C00>VAT RECEIPT SUMMARY
<J00>Rate | NET | VAT
{TAXES}
<EB>
<J00>VAT TOTAL | [={TICKET TOTAL}-{TAX TOTAL}] | {TAX TOTAL}
<DB>
<C00>VAT No.: GB 123456789
<F>=

[TAXES]
<J00>{TAX RATE}% VAT | {TAXABLE AMOUNT} | {TAX AMOUNT}

and this is the printer output for that section:

I want 3 equally distributed columns (or at least somewhat), but instead I get one large and 2 small columns for the output. So I would want the “NET” column to be more in the centre. Is this because of other use of <J00> within my template? If so, is there a way I can “reset” the justification for a specific section of the template?

1 Like

How about add extra space after {TAXABLE AMOUNT}?

But there is already a space after it. Adding an extra space doesn’t make any difference.

It’s related to the way the template parser is working out the columns used when you use justified tag. I think it’s global across the entire receipt, which is causing this as on my receipt I use the tag for a few different things.

Different sections using the tag should really be handled separately but I don’t know if there is a way to do that?

@emre is that correct?

There are some tricks you can use for that. We had this discussion before RickH was part of it if I remember. Look up some old threads from me and RickH … i cant remember what they were titled though.

Found it!

I didn’t realise that. I always thought it would evenly distribute the columns across the ticket. I can see why it was made that way, but definitely feel it would be more flexible if we had a way to have evenly spaced columns that can be spaced automatically without the need to manually pad them. I know I can do with Document Printer however really don’t want to go down that route just for a simple “table like” structure.

1 Like

I think the same as you on this. I did a few tricks to get decent looking ticket but yeah something like you explained would be good.

1 Like

I think this is good standard format. But it should be able to add space to move middle column if needed. Right now spaces were removed :(.

Actually I like default one. I think it would look weird if middle column right at the center. Well, it should say depend what contents in it.

BTW, I think you don’t need document printer. You can actually feed output to script and you can manipulate that.

1 Like

Yeah, I was just looking (hoping) for something simpler as I thought a way already existed.

I am trying to replicate the format of the VAT summary part as in the example receipt image in this post I added a while back…

I just added an additional “column” and padded it with 6 spaces. Actually I managed to get the middle column centred but it didn’t look good, so right now what I have will suffice.

For reference, updated template part:

<F>-
<C00>VAT RECEIPT SUMMARY
<J00>Rate | NET |      | VAT
{TAXES}
<EB>
<J00>VAT TOTAL | [={TICKET TOTAL}-{TAX TOTAL}] |      | {TAX TOTAL}
<DB>
<C00>VAT No.: GB 123456789
<F>=

[TAXES]
<J00>{TAX RATE}% VAT | {TAXABLE AMOUNT} |      | {TAX AMOUNT}
4 Likes

I use the J tag for simple things, but when I want full control, I just use L tag and use L/R pad functions/expressions for each column to get exactly what I want. This does require that you know the exact character width/count of the Printer and of course that changes from model to model, even in the same Brand. But ultimately, this is the only way to get full control over the columns.

4 Likes