# Problem with Barcode tag in printer template

**URL:** <https://forum.sambapos.com/t/problem-with-barcode-tag-in-printer-template/29968>\
**Category:** V5 Issue\
**Created:** [December 21, 2024, 3:49am UTC](https://forum.sambapos.com/t/problem-with-barcode-tag-in-printer-template/29968 "2024-12-21T03:49:16Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [December 21, 2024, 3:49am UTC](https://forum.sambapos.com/t/problem-with-barcode-tag-in-printer-template/29968/1 "2024-12-21T03:49:16Z")

</div>

I just recently updated to 5.7.14

With this update I have a problem printing a barcode on a receipt. It is throwing this popup error:

```auto
There is a problem

Message:
Length can not be less than zero.
Parameter name: Length

```

I am pretty confident it is the barcode because when I comment out the barcode line, there is not error message.

I have tried all the variation of the [barcode tag](https://forum.sambapos.com/t/printer-template-formatting-tags/328) `<BAR>,<BAR13>, <BAR39>, <BAR08>, <BAR93>, <BAR11> & <BAR25>` `<QR>` does not give the error, but does not print the QR code.

I have tried hard coding the numbers behind the bar tag.

Here is the error log:

```auto
12/20/2024 9:25 PM
-----------------------------
[General Info]

Application: SambaPOS
Version: 5.7.14
Region: en
DB: SQ
Machine: LAPPY-IV
User: Bob
Date: 12/21/2024
Time: 3:25 AM

User Explanation:

Bob said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type: System.ArgumentOutOfRangeException
Message: Length cannot be less than zero.
Parameter name: length
Source: mscorlib
Stack Trace: at System.String.Substring(Int32 startIndex, Int32 length)
   at Samba.Services.Implementations.PrinterModule.LinesToFlowDocumentConverter.ConvertTagsToHtml(String[] lines, Printer printer)
   at Samba.Services.Implementations.PrinterModule.LinesToFlowDocumentConverter.ConvertLinesToFlowDocument(String[] lines, Printer printer)
   at Samba.Services.Implementations.PrinterModule.PrinterService.PrintTicketToFlowDocument(Printer printer, Ticket ticket, PrinterTemplate printerTemplate)
   at Samba.Presentation.Services.Implementations.ReportService.GetTicketPreview(PrinterTemplate printerTemplate, String printerName)
   at Samba.Management.PrinterModule.PrinterTemplateViewModel.OnTicketPreview(String obj)

-----------------------------

[Assembly Info]

mscorlib, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
System, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Services, Version=5.7.14.1210
System.ComponentModel.Composition, Version=4.0.0.0
System.Configuration, Version=4.0.0.0
DevExpress.Xpf.Core.v17.2, Version=17.2.13.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=5.7.14.1210
Samba.Infrastructure, Version=5.7.14.1210
Microsoft.Practices.Prism, Version=4.0.0.0
Samba.Domain, Version=5.7.14.1210
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
Samba.Presentation.Common, Version=5.7.14.1210
System.Drawing, Version=4.0.0.0
System.Core, Version=4.0.0.0
DevExpress.Data.v17.2, Version=17.2.13.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Localization, Version=5.7.14.1210
Samba.Persistance, Version=5.7.14.1210
FastButton, Version=1.0.0.0
Samba.Infrastructure.Data, Version=5.7.14.1210

-----------------------------

[System Info]

Operating System
-Microsoft Windows 11 Pro
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -360
--FreePhysicalMemory = 4524692
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 10.0.22631

Machine
-LAPPY-IV
--Manufacturer = SAMSUNG ELECTRONICS CO., LTD.
--Model = 950QDB
--TotalPhysicalMemory = 16837500928
--UserName = LAPPY-IV\Bob

-----------------------------

######################### E N D #########################

```

Any guidance is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![YILDIZHANPOS](https://forum.sambapos.com/user_avatar/forum.sambapos.com/yildizhanpos/32/62703_2.png) [@YILDIZHANPOS](https://forum.sambapos.com/u/YILDIZHANPOS)\
**Post date:** [December 21, 2024, 4:32am UTC](https://forum.sambapos.com/t/problem-with-barcode-tag-in-printer-template/29968/2 "2024-12-21T04:32:17Z")

</div>

Template

```auto
<L>
<BAR>123

First <L>

```

---

<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:** [December 21, 2024, 4:51am UTC](https://forum.sambapos.com/t/problem-with-barcode-tag-in-printer-template/29968/3 "2024-12-21T04:51:08Z")

</div>

Thank you, that did the trick! It is working now.

---

<div class="post-metadata">

**Author:** ![YILDIZHANPOS](https://forum.sambapos.com/user_avatar/forum.sambapos.com/yildizhanpos/32/62703_2.png) [@YILDIZHANPOS](https://forum.sambapos.com/u/YILDIZHANPOS)\
**Post date:** [December 21, 2024, 12:59pm UTC](https://forum.sambapos.com/t/problem-with-barcode-tag-in-printer-template/29968/4 "2024-12-21T12:59:15Z")

</div>

```auto

[='{TICKET TYPE}'=='Paket Servis'?'<div style="font-size:0.1px;font-family:Calibri"><table><tr><td width=1 align=Center>.</td><td width=249 align=center><L><!rn><BAR>{TICKET ID}<!rn></td></tr></table></div>':'']

```

HTML
