0

Can't print the label correctly. There is some extra spaces in the ZPL text field.

There are some spaces between the text fields in line 2 and line 4. Please kindly help.

^XA^LL496
^PW711
^FT16,50^A0N,20,19^FDL-01,02,03^FS
^FT16,100^A0N,20,19^FDU-01,02,03^FS
^FT16,150^A0N,23,24^FDUSER ID:admin^FS
^FT16,200^A0N,23,24^FDPromise Date:02/15/16^FS
^FT16,250^A0N,23,24^FDDate of Request: 11/14/19 01:48PM^FS
^PQ1,0,1,Y^XZ

Result:

L-01,02,03  
U-      01,02,03    <-- Extra space  
USER ID:admin  
Promise    Date:02/15/16    <- Extra space here  
Date of Request: 11/14/19 01:48PM

My Zebra printer : Zebra Z4Mplus 203DPI

I have found this message from internet : http://support.efficientbi.com/knowledge-base/extra-spaces-in-label-text-appear-when-sending-zpl-commands-direct-to-windows-generic-printer-driver-zebra-problem/

"When testing sending ZPL print commands direct to a Zebra printer using Generic Windows print driver, it we noticed that sometimes extra spaces would appear in the sample label. After some research, it was determined that it appears the Generic Windows print driver will cause these extra spaces to be inserted when the ZPL code is sent WITHOUT CRLF breaks."

I am using the "Generic Windows print driver" for my Zebra printing. Here is the link that I used : JavaScript: Send raw text to printer - no server requests/method calls, able to work offline, purely clientside

The output format totally mess up in the Zebra printing. On the other hand, the Labelary looks good to me though.

I am using the Java Vaadin framework and call the javaScript to print the ZPL command to use the "Generic Windows print driver". It worked but the format did not look to me. Extra spaces everywhere and some text did not show up at all but it looks OK in Labelary though.

I tried to print the label in client machines with Zebra printer for my Java Vaadin server side application and I finally able to make it printing but don't know why the format looks totally unpredictable.

My label size is : 3.5 inches X 2 inches label.

I can print the whole field now but still got extra space on the output. ^XA^LL496 ^PW711 ^FT16,209^A0N,20,19^FH^FDL-01,02,03^FS ^FT16,169^A0N,20,19^FH^FDU-01,02,03^FS ^FT16,249^A0N,23,24^FH^FDUSER ID:admin^FS ^FT16,289^A0N,23,24^FH^FDPromise Date: 02/15/16^FS ^FT16,329^A0N,23,24^FH^FDRequest: 11/14/19 01:48 PM^FS ^FT16,369^A0N,23,24^FH^FDMatl: ST30^FS ^FT7,101^A0N,113,112^FH^FDX^FS ^BY4,2.5,59^FT131,87^B3N,N,,Y,N ^FD2246284^FS ^PQ1,0,1,Y^XZ

Here is the image: There are some extra spaces in the print label from Zebra printer.

enter image description here

Samuel Lin
  • 11
  • 4
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackoverflow.com/rooms/204147/discussion-on-question-by-samuel-lin-cant-print-the-label-correctly-there-is-s). – Samuel Liew Dec 12 '19 at 20:57

3 Answers3

1

I know it's an old question. I had similair problem printing through cups, turned out the default options had margins set in them. Setting them to zero and Long Line Handling to 'Wrap at Right Edge' fixed my problem:

Martijn
  • 11
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 03 '22 at 15:06
0

Finally I am able to get rid of this extra spaces by adding \ +\n string at he end of each java script statement. We need two \\ characters, the first \ character as the escape character to make it working.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Simon Kao
  • 3
  • 1
0

Finally I am able to get rid of this extra spaces by adding \ +\n string at he end of each java script statement. We need two \ characters, the first \ character as the escape character to make it working.

Simon Kao
  • 3
  • 1