# Com Port printer not formatting properly

**URL:** <https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922>\
**Category:** V5 Question\
**Created:** [October 19, 2016, 8:12pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922 "2016-10-19T20:12:41Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 8:12pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/1 "2016-10-19T20:12:41Z")

</div>

Im trying to integrate our new surveillance software with samba. Surveillance software is not recognizing sambas print data for some reason. Samba is printing to a com port which is redirected to another com port that surveillance listens on. I am 99% sure its a formatting thats causing my issue.

Look how sambas printout shows on putty:

 ![](https://forum.sambapos.com/uploads/default/original/3X/1/d/1dc33031c5474b597c60d7d1d0c0ba66acce0ec7.png)

Look how it shows on the example pos data sender program surveillance company provided. When I send data through this program, surveillance software picks it up just fine.

 ![](https://forum.sambapos.com/uploads/default/original/3X/0/3/03b2643ecc065c4761d81e2a53ebdf4dbe499a8b.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/d/6/d6a9de35410127c2b3f8cad1bddb889401d3efed.png)

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 9:12pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/2 "2016-10-19T21:12:17Z")

</div>

@emre

Is there any way that I can set max character limit per line for com port printer. Or even somehow use new line command? Im pretty sure if I can do that ill be okay.

Is there anyway to allow printing with printer type ESC/POS to directly COM port. I changed my printer type to that and set the printer name to an unconnected epson printer which I set on COM 3 and the surveillance software picks it up fine and formatting is good but i get printer unavailable message from windows every time. So that proves that my issue is COM printer on samba side.

---

<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:** [October 19, 2016, 9:34pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/3 "2016-10-19T21:34:22Z")

</div>

Can you not make a new printer using com3 rather than change unconected one to com3?

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 9:38pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/4 "2016-10-19T21:38:11Z")

</div>

No samba doesnt let you set name to com3 for ESC/POS printers @JTRTech

---

<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:** [October 19, 2016, 9:39pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/5 "2016-10-19T21:39:18Z")

</div>

No I mean manually add a printer in windows, use com3 and try generic text driver… then use escpos mode to that printer name…  
worth a try

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 9:39pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/6 "2016-10-19T21:39:53Z")

</div>

How would I add a manual printer in windows? @JTRTech

---

<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:** [October 19, 2016, 9:40pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/7 "2016-10-19T21:40:30Z")

</div>

Really :-P?

 ![](https://forum.sambapos.com/uploads/default/original/3X/8/3/8361add831e16d8381bb0b79ff25b4c862c532f0.jpg)

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 9:41pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/8 "2016-10-19T21:41:09Z")

</div>

im on windows 10 lol @JTRTech windows 10 tries to search for a printer and wont let me specifiy manual printer.

---

<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:** [October 19, 2016, 9:43pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/9 "2016-10-19T21:43:29Z")

</div>

You can still get to old version on one of the options at the bottom.

 ![](https://forum.sambapos.com/uploads/default/original/3X/f/b/fb910b2d008c08db024ca4abd1a6aac65f0e626c.png)

Or in win 10;

 ![](https://forum.sambapos.com/uploads/default/original/3X/b/8/b8b90f1f9fb7bb7cc7255424389bdabf3e59ce25.png)

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 9:45pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/10 "2016-10-19T21:45:01Z")

</div>

oh great thanks, what printer driver should I select? @JTRTech

---

<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:** [October 19, 2016, 9:45pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/11 "2016-10-19T21:45:22Z")

</div>

Id try with just generic text if nothing else.

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 10:02pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/12 "2016-10-19T22:02:12Z")

</div>

That actually worked, but for some reason seeing ! before every line.

By the way on a printer template how do I actually output this as text to my program. samba thinks its formatting functions @JTRTech

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

---

<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:** [October 19, 2016, 10:17pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/13 "2016-10-19T22:17:28Z")

</div>

Not sure, what actually do you need to send to it?  
Maybe you might be better looking at a script to post/echo to the port…  
Looks almost like xml

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 10:19pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/14 "2016-10-19T22:19:34Z")

</div>

It is XML.

I basically want to send ticket information in xml format so pos software recognizes it. But samba is reading the xml functions and thinking its for formatting or whatever and it wont show them in the output. is there something i can do to tell samba to not see it as a function but rather just output it as text @JTRTech

---

<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:** [October 19, 2016, 10:29pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/15 "2016-10-19T22:29:30Z")

</div>

Not sure, wouldn’t be a typical use of printer template…  
Have you tried putting normal formatting tags on beginning of lines in front?  
Scripts defiantly have xml support…

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 10:37pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/16 "2016-10-19T22:37:53Z")

</div>

How would I output to port with script. I have never used script feature. @JTRTech

---

<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:** [October 19, 2016, 10:50pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/17 "2016-10-19T22:50:29Z")

</div>

Pretty sure there is a way, sure was going along those lines when tinkering with card intergration as that was xml…  
FYI don’t need to get me in every reply 😛

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 19, 2016, 10:57pm UTC](https://forum.sambapos.com/t/com-port-printer-not-formatting-properly/12922/18 "2016-10-19T22:57:20Z")

</div>

Got it by setting printer type to “Text”

Thanks
