What is the difference between .lbl and .zpl extension? - zebra-printers

I have a code which generates a ZPL file which can be sent directly to a printer or downloaded like a file with a .zpl extension. My question is what is the difference between this .zpl and .lbl extension files? The code for the ZPL is below.
^XA
^FX Top section with logo, name and address.
^CF0,60
^FO210,100^FDCompany Name Here^FS
^FX Second section with item information
^CFA,30
^FO30,300^FDITEM NAME: Printer^FS
^FO30,340^FDSERIAL NO: 12345^FS
^FX Third section with bar code.
^BY4,2,250
^FO100,550^BC^FDsparc123^FS
^XZ
If they are the same does it mean I can change the file extension from .zpl to .lbl and print it without a problem?

.lbl extension is the one produced by a label design software (.lbl is the extension of the files created by zebradesigner 2, for example, while .nlbl is the extension of zebradesigner 3), while .zpl files contain the zpl code the printer actually needs to produce a label.
You can better picture the difference comparing the .lbl (or .nlbl) files as a .docx file and a .zpl file as a .txt file
If you open a .lbl file with a text editor, you'll see it doesn't contain zpl commands, so you can't simply swap the file extensions

Related

Spacing issue between letters while converting Word to PDF on Windows

I am having a word document(docx) of urdu text in Jameel Noori Nastaleeq Font. And in word its showing 10 pages file but after exporting into PDF its showing 11 pages pdf file becuase every letter contains extra space.
Can anyone please provide information ?
Edited:
Please download the file from
File
It has to do with the XML formatting of Word. When any text is pasted into Word (while the font is Jameel Noori Nastaleeq) Word places extra formatting in between the words. That formatting shows fine in Word however in when the file is converted into PDF the extra space becomes visible. When the text is merely typed in Word, the formatting is applied to entire paragraphs rather than words. That is why a typed document doesn't contain the extra spaces.

why does zebra printer output use ^GFA ?

I designed a label in a Zebra Label Designer and outputed the zpl code to a file. All my text is encoded in a ^GFA command which is not useable to me because I want to be able to replace text in the label progromatically. How do I design my labels so that the text is not encoded in the program code?
Make sure you use printer-resident fonts when you add a text field in ZebraDesigner. The printer-resident font names listed in the dropdown box of ZebraDesigner typically start with the word Zebra.

Printing Images with ZPL code

I'm using ZDesigner to create my label and generate the zpl code. My label have several text boxes, a barcode, and a logo image.
I used the generated code on this webpage -> http://labelary.com/viewer.html, and the output was fine.
When I send the same zpl code to the printer (GC420D, installed as generic/text only) the logo image it's not printed.
ZDesigner uses the command ^GFA to send the image to the printer, I tried with diferent extensions (.pgn, .jpg and .bmp) and the results is always the same, no logo.
Any ideas why?
generated code:
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ
^XA
^MMT
^PW570
^LL0320
^LS0
^FO220,170^GFA,8000,0800,00020,:Z64:
eJztkjFugzAUhp+dICrUAUsQ1ogJsVXNASzV6dTBSH7KmiN4SMWKsvcOiAlxigw9QIdwnxooGFVl6FCpQ/7Blu3P7/2/ZYCb/pvIm2T37y9XLpk/bRbdUEEMiQUfpe88w+b4MLtcjMOd3XMA1oILIcnfmabnpvSg9GhTTHvuKtcbcty4OZ9z9cCV1h+RKiA8AGI5j5ZJSguT1nKuy/VuxXdAjjOuSJKOo7ZviBcZkEtA2svUNo2rnvOsv/BwQH1yQUczf55XlB2XThxRao9KOiCVM3LUcLRKht5jCpZH4auOiNaufZfaBKnTc5l4Iyfwim2LLX5ga9vWXnNOq6ZMm7FtdthFeZY/nXSkYVlrMRRV49oeUTrjmE/QjAy/MvjwswRBRGkL9jiNId7205De2JNhliECw6Hg9DTfxZX5eYYRBjbXhHU3Ouxdku5vMiY7h8gJLtlb9/mEMrn3xqjo2m5n5zTezuIxE4JlRnKhHHA7CaOlFHMRxpbc3XTTr/QJea9YBw==:F9E4^FS
^FT128,67^A0I,12,14^FH\^FDData de Emiss\C6o^FS
^FT128,129^A0I,12,16^FH\^FD#DOCUMENT#^FS
^FT76,103^A0I,12,16^FH\^FD#VAL#^FS
^FT100,49^A0I,12,16^FH\^FD#DE#^FS
^FT255,50^A0I,12,16^FH\^FD#CE#^FS
^FT408,46^A0I,12,16^FH\^FD#CC#^FS
^FT110,209^A0I,12,16^FH\^FD#Eur#^FS
^FT134,227^A0I,12,16^FH\^FDRecibo n\A7^FS
^FT124,101^A0I,12,16^FH\^FDEur^FS
^FT300,67^A0I,12,19^FH\^FDC\A2digo Entidade^FS
^FT434,67^A0I,14,16^FH\^FDC\A2digo Cliente^FS
^BY2,3,20^FT441,119^BCI,40,Y,N
^FD>;12345678>69^FS
^PQ1,0,1,Y^XZ
here is my answer a little late but it may be useful for someone. I had a problem when performing a print service for an android application, when pasting the zpl code into the text editor I was not noticing that for some reason some blank spaces were being added, I realized until I copied the code and I viewed it here http://labelary.com/viewer.html
after that I remove the blank spaces and the image could be displayed
zpl code with blank spaces

Batch file to remove text between 2 characters

Is it possible to write a Windows batch file that can delete all text between 2 characters, including the characters themselves?
I am dynamically generating text files that includes a piece of text in HTML format. I want to extract only the non-HTML part of the text, meaning, I want to remove all HTML tags from it.
So, I want a Windows batch file that takes a text file as input, removes all characters between < and > (including) and creates an output file. Can you please help me with this?

How can I output .doc files with bolded and colored text

I need to output text to a .doc file. I am currently just outputting to a file like usual and using a .doc at the end of the file name
File.open('output_file.doc', 'a+') {|x| x.write(str)}
The issue is I want to make some of the text red and bold. How can this be achieved? I am using ruby, but I can easily switch to jruby thanks to the amazingness that is rvm, so if there are java libraries for this, that'd be great as well.
The short answer: use .rtf and then convert to .doc using word or open office. The following .rtf file (writes "normal text red text more normal text." and colors and bolds the red text):
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;\red255\green0\blue0;}
\margl1440\margr1440\vieww13280\viewh10420\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\f0\fs24 \cf0 normal text
\b \cf2 red text
\b0 \cf0 more normal text.}
The long answer:
Strings are just plain ascii text, so there is no command that can make them bold. This is a property of all files in general, not just how Ruby works with files.
What text-editors do is use key strings within the file as commands to render the text in a certain way. For example, double asterisk surrounds bold text in the Stack Overflow editor. The file format of a file determines these rules.
.rtf is a basic file format that has the features you want and is easy to convert to .doc using msword or open office. THe advantage to .rtf is that it is human readable. So you can write an rtf file with red text, rename it .txt and open in a text editor and see what "decorations" the red font added. Play around with the parameters
If you are curious, the complete .rtf specifications can be found here:
http://www.biblioscape.com/rtf15_spec.htm
What's all the garbage at the top? That is header stuff. Fortunately you don't need to add more header material to add more text.

Resources