# Reduce size of barcode (html printer)

**URL:** <https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802>\
**Category:** V5 Question\
**Created:** [February 13, 2021, 8:34pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802 "2021-02-13T20:34:30Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![josephrussell](https://forum.sambapos.com/user_avatar/forum.sambapos.com/josephrussell/32/57854_2.png) [@josephrussell](https://forum.sambapos.com/u/josephrussell)\
**Post date:** [February 13, 2021, 8:34pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/1 "2021-02-13T20:34:30Z")

</div>

Is there anyway to size down the barcode (html printer). I’m seen on the forum that ESC/POS is smaller, but the barcode on the html print is pretty large. I tried wrapping a div with a height parameter. No luck.

![IMG_3083](https://forum.sambapos.com/uploads/default/original/3X/1/5/1571920a446e28f0b7c41984a6a5769132523277.jpeg)

---

<div class="post-metadata">

**Author:** ![josephrussell](https://forum.sambapos.com/user_avatar/forum.sambapos.com/josephrussell/32/57854_2.png) [@josephrussell](https://forum.sambapos.com/u/josephrussell)\
**Post date:** [February 15, 2021, 12:30am UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/2 "2021-02-15T00:30:26Z")

</div>

Any ideas on this? The forum isn’t yielding much for results.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [February 15, 2021, 12:45am UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/3 "2021-02-15T00:45:35Z")

</div>

No unfortunately we can’t.

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [February 15, 2021, 4:55pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/4 "2021-02-15T16:55:55Z")

</div>

I have not tried, but maybe a barcode font would work?

---

<div class="post-metadata">

**Author:** ![josephrussell](https://forum.sambapos.com/user_avatar/forum.sambapos.com/josephrussell/32/57854_2.png) [@josephrussell](https://forum.sambapos.com/u/josephrussell)\
**Post date:** [February 15, 2021, 5:30pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/5 "2021-02-15T17:30:10Z")

</div>

Pretty sure there isn’t a built-in barcode font and linking external fonts doesn’t seem to be supported

> **[Tryit Editor v3.6](https://www.w3schools.com/howto/tryit.asp?font=Libre%20Barcode%2039)**

No go here

```auto
-- Styling
<link href='https://fonts.googleapis.com/css?family=Libre Barcode 39' rel='stylesheet' />

-- Address and Website
<div style="padding: 5px; text-align: Center; background-color: #000000 black; color: #ffffff; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">113 E Holly St<Br/>Bellingham, WA 98226<Br />(360) 933-4301</div>
<div style="padding: 5px; text-align: Center; background-color: #ffffff black; color: #000000; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Order Online @ Horseshoecafe.com</div>

-- Spacer
<div style="width: 100%; height: 5px;"> </div>
<div style="width: 100%; height: 20px;"><span style="font-family: 'Libre Barcode 39'; font-size: 22px;">123456789</span></div>

```

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [February 15, 2021, 5:33pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/6 "2021-02-15T17:33:54Z")

</div>

On HTML printing mode it creates a bmp image of the barcode under windows temp folder and adds it as an image to the printing document.

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [February 15, 2021, 6:13pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/7 "2021-02-15T18:13:50Z")

</div>

It was just a thought. You have much more experience and would be able to figure it much faster than I could…if it was possible.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [February 16, 2021, 3:20pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/8 "2021-02-16T15:20:49Z")

</div>

I’d say maybe not using built in feature and requesting via external system.

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [February 16, 2021, 5:19pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/9 "2021-02-16T17:19:05Z")

</div>

can you show your template with the barcode line please, i cant seem to get a barcode to print while using html mode on tickets

---

<div class="post-metadata">

**Author:** ![josephrussell](https://forum.sambapos.com/user_avatar/forum.sambapos.com/josephrussell/32/57854_2.png) [@josephrussell](https://forum.sambapos.com/u/josephrussell)\
**Post date:** [February 16, 2021, 5:55pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/10 "2021-02-16T17:55:06Z")

</div>

All I have is \<BAR\>{TICKET ID} at the bottom of my template.

```auto
[LAYOUT]
-- Address and Website
<div style="padding: 5px; text-align: Center; background-color: #000000 black; color: #ffffff; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">113 E Holly St<Br/>Bellingham, WA 98226<Br />(360) 933-4301</div>
<div style="padding: 5px; text-align: Center; background-color: #ffffff black; color: #000000; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Order Online @ Horseshoecafe.com</div>

-- Spacer
<div style="width: 100%; height: 5px;"> </div>
<div style="width: 100%; height: 20px;"><span style="font-family: 'Libre Barcode 39'; font-size: 22px;">123456789</span></div>

-- Header Info Layout
<table>
<tr>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px; font-size:10px;padding:5px;">{DATE:MMM} {DATE:dd}</div>
<div style="height: 20px; font-size:14px;padding:2px;">[=Helper.GetUniqueString().substr(8,2)]:[=Helper.GetUniqueString().substr(10,2)]</div>
-- <div style="height: 20px; font-size:14px;padding:2px;">{TIME}</div>
-- <div style="height: 10px; font-size:10px;padding:5px;">{DATE:yyyy}</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Table</div>
<div style="height: 20px;font-size:14px;padding:2px;">{ENTITY NAME:Table}</div>
-- <div style="height: 10px;font-size:10px;padding:5px;">*icon*</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Ticket</div>
<div style="height: 20px;font-size:14px;padding:2px;">{TICKET NO}</div>
-- <div style="height: 10px;font-size:10px;padding:5px;">*icon*</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Server</div>
<div style="height: 20px;font-size:14px;padding:2px;">{ENTITY NAME:Server}</div>
-- <div style="height: 10px;font-size:10px;padding:5px;">*icon*</div>
</td>
</tr>
</table>

-- <div style="width: 100%; height: 10px;"> </div>
-- <div style="padding: 5px; text-Align: center; border: 1px black solid; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Welcome, [='{ENTITY NAME:Customer}'==''?'Guest':'{ENTITY NAME:Customer}']</div>

-- Spacer
<div style="width: 100%; height: 10px;"> </div>

{ORDERS}
<div style="width: 100%; height: 10px;"> </div>
<div style="padding: 0px; text-Align: center; font-family:'Helvetica'; font-size:12px; font-weight:bold;line-height: 1.6em;">{TICKET QUANTITY SUM}x Items Sold</div>
 
{DISCOUNTS}
[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]
{SERVICES}
-- <table><tr>
-- <td width="275" align="center">&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</td>
-- </tr></table>

<J00>-------------------------------------------
<div style="font-size:14px;font-weight:bold;text-align:justify;font-family:'Helvetica'">
<table>
<tr>
<td width="200" align="left">Sub Total:</td>
<td width="55" align="right">[=F(TN('{PLAIN TOTAL}'),'0.00')]</td>
</tr>
</table>
</div>
<J00>-------------------------------------------

<table>
<tr>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">Tax:</span></td>
<td width="55" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{TAX TOTAL}</span></td>
</tr>
</table>
{PAYMENTS}

<div style="width: 100%; height: 10px;"> </div>
<div style=" background-color: #000000 black; color: #ffffff; padding: 5px; text-Align: center; border: 1px black solid; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Thank you for Visiting the 'Shoe<br /> We'll see you next time<Br />Horseshoe Cafe Est. 1886</div>
<div style="width: 100%; height: 10px;"> </div>

<div style="padding: 5px; text-Align: left; border: 1px black solid; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">
<table>
<tr><td align=center><span style="text-align:center; font-family:'Helvetica'; font-size:14px;">*Voluntary* Health Contact Info<Br /></span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">Name: &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">Phone: &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">E-mail: &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;<Br /></span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:10px;">If we learn you may have been exposed to COVID-19 during your visit, we will only share this information with public health officials. We will not use your info for any other purpose.</span></td></tr>
</table>
</div>
<div style="width: 100%; height: 10px;"> </div>

<BAR>{TICKET ID}

[DISCOUNTS]
<table>
<tr>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">{CALCULATION NAME} %{CALCULATION AMOUNT}</span></td>
<td width="55" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{CALCULATION TOTAL}</span></td>
</tr>
</table>

[SERVICES]
-- <J10>{CALCULATION NAME}|{CALCULATION TOTAL}

[PAYMENTS]
<table>
<tr>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">{PAYMENT NAME}</span></td>
<td width="55" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{PAYMENT AMOUNT}</span></td>
</tr>
</table>

[ORDERS]
<table>
<tr>
<td width="25"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">- {QUANTITY}</span></td>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">{NAME}</span></td>
<td width="30" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{TOTAL PRICE}</span></td>
</tr>
{ORDER TAGS}
</table>

[ORDERS:Gift]
-- Format for gifted orders
<table>
<tr>
<td width="25"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">- {QUANTITY}</span></td>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;"> **COMP** {NAME}</span></td>
<td width="30" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{TOTAL PRICE}</span></td>
</tr>
{ORDER TAGS}
</table>

[ORDER TAGS]
-- Format for order tags
<tr>
<td width="25"><span style="text-align:left; font-family:'Helvetica'; font-size:12px;">***</span></td>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:9px;">{ORDER TAG NAME} </span></td>
<td width="30" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:9px;">[=F(TN('{ORDER TAG PRICE}')*TN('{ORDER TAG QUANTITY}')*TN('{QUANTITY}'),'#.00')]</span></td>
</tr>

```

Its supported as of 4.1.18

> [@\[New 4.1.18\] HTML Printer Improvements](https://forum.sambapos.com/t/new-4-1-18-html-printer-improvements/654):
>
> ###Changes HTML Printer correctly handles \<T\> and \<F\> tags. HTML Printer supports \<BAR\> tag. HTML Printer supports \<BMP\> tag. \<div\> and \<span\> HTML tags implemented. ###Styling By using \<div\> and \<span\> tags it is possible to use inline html styles for formatting output. [LAYOUT] -- General layout \<div style="font-weight:bold;font-size:13px"\> \<BMP\>c:\logo.bmp \<T\>Ticket \<L00\>Date:{TICKET DATE} \<L00\>Time:{TIME} {ENTITIES} \<L00\>Ticket No:{TICKET NO} \<F\>- {ORDERS} \<F\>= \<EB\> {DISCOUNTS} [\<J10\>T…

---

<div class="post-metadata">

**Author:** ![Posflow](https://forum.sambapos.com/user_avatar/forum.sambapos.com/posflow/32/63001_2.png) [@Posflow](https://forum.sambapos.com/u/Posflow)\
**Post date:** [February 17, 2021, 12:23am UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/11 "2021-02-17T00:23:19Z")

</div>

> [@josephrussell](#):
>
> ```auto
> <div style="width: 100%; height: 10px;"> </div>
> 
> <BAR>{TICKET ID}
> 
> ```

That actually works? 😯

---

<div class="post-metadata">

**Author:** ![josephrussell](https://forum.sambapos.com/user_avatar/forum.sambapos.com/josephrussell/32/57854_2.png) [@josephrussell](https://forum.sambapos.com/u/josephrussell)\
**Post date:** [February 17, 2021, 1:40am UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/12 "2021-02-17T01:40:50Z")

</div>

Ticket on the first post is using it. The post from Emre above explains that BAR suport was added for HTML printing, so guess so.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [February 17, 2021, 2:59am UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/13 "2021-02-17T02:59:21Z")

</div>

Yes you can use barcode esc/pos command in html mode.

It saves an image in temp folder and then inserts it.

---

<div class="post-metadata">

**Author:** ![josephrussell](https://forum.sambapos.com/user_avatar/forum.sambapos.com/josephrussell/32/57854_2.png) [@josephrussell](https://forum.sambapos.com/u/josephrussell)\
**Post date:** [March 21, 2021, 8:08pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/14 "2021-03-21T20:08:02Z")

</div>

I decided to implement barcode generation using Zint instead. This allows me to control the barcode generation and define sizing such as height and scaling.

> **[Zint Barcode Generator](https://sourceforge.net/projects/zint/)**
>
> Download Zint Barcode Generator for free. A barcode encoding library supporting over 50 symbologies. Encodes data into any of the following: Australia Post barcode, Aztec Code, Aztec Runes, Channel Code, Codabar, Codablock-F, Code 11, Code 128, Code...

![image](https://forum.sambapos.com/uploads/default/original/3X/d/2/d25cae98540de51ab4a04a457824623df0520f1a.png)

 ![image](https://forum.sambapos.com/uploads/default/original/3X/0/f/0ff85ddef1f6e349c664206ffff3638a577b20de.png)

![image](https://forum.sambapos.com/uploads/default/original/3X/1/0/1007a51855b1a0cbf7c0472d7d0259905e3c4e3e.png)

 ![image](https://forum.sambapos.com/uploads/default/original/3X/b/7/b7b3a6479f8e41a707f783878c095da7f982761c.png)

---

<div class="post-metadata">

**Author:** ![josephrussell](https://forum.sambapos.com/user_avatar/forum.sambapos.com/josephrussell/32/57854_2.png) [@josephrussell](https://forum.sambapos.com/u/josephrussell)\
**Post date:** [March 22, 2021, 8:00pm UTC](https://forum.sambapos.com/t/reduce-size-of-barcode-html-printer/23802/15 "2021-03-22T20:00:12Z")

</div>

I would also note that the increase in image quality using Zint is immense. See below.

**Left is using Zint, right is SambaPOS \<BAR\>**

 ![image](https://forum.sambapos.com/uploads/default/original/3X/c/8/c843c53441175a866b7e34f4917cbd9dd9f32e9b.jpeg)
