Search This Blog

Tuesday, February 10, 2009

Printing Barcode on a zebra Printer using ZPL

Here we will discuss on how to automatically print Barcodes on a zebra printer from Oracle concurrent program.
Below are the 3 approaches that we tried and was successful with the third approach.
1) Print Labels on a Zebra printer using BI Publisher
The first approach we tried was to print barcodes using BI(formerly XML) Publisher. The report generates a PDF output and should print directly on a Zebra printer using PASTA driver. For some reason the report was not printing directly on a printer. The PDF opened in window and printed seperately/manually using Windows driver was working fine but not meeting our requirement of automatic printing. Hence we had to try second approach.
2) Print Labels using Zebra Enterprise Connector Solution
The Zebra Enterprise Connector Solution is designed to streamline the printing
process for companies using ERP systems such as Oracle BI Publisher. The Zebra
Enterprise Connector Solution helps to lower middleware costs, overhead, and
pre-printer licensing fees. It can be used with an unlimited number of
Zebra ZPL-II printers without additional per-printer licensing fees. We didnt do much research on this as were looking for an approach with minimal cost. More details on this is available at the website of Zebra
3) Print Lables on Zebra printers using Zebra Programming Language(ZPL)
The second and successful approach was to print labels using ZPL. A text output with all the zebra codes was created and which would ultimately print Barcode images on a printer. A normal regular lp command for printing text is used to print over Zebra Printers.
Below is an example of how to print Barcodes

^FO40,35^AR,10,10^FDItem :^FS
^FO40,115^AR,10,10^FDItem Description:^FS
^FO40,165^AR,10,10^FDQuantity :^FS
^FO40,245^AR,10,10^FDDiscrete Job# :^FS
^FO40,295^AR,10,10^FDSupply Sub :^FS
^FO40,375^AR,10,10^FDLocator :^FS
^FO40,455^AR,10,10^FDDestination Sub :^FS
^FO40,505^AR,10,10^FDLocator :^FS
^FO40,555^AR,10,10^FDOrder # :^FS
^FO40,635^AR,10,10^FDLine # :^FS
^FO40,715^AR,10,10^FDOrder Type :^FS
^FO40,765^AR,10,10^FDDepartment :^FS^FO305,765^AR,10,10^FDResource Group :^FS
^FO40,845^AR,10,10^FDWork Center :^FS^FO305,845^AR,10,10^FDItem Sequence :^FS
^FO40,925^AR,10,10^FDAsm Item # :^FS^FO305,925^AR,10,10^FDAsm Item Desc :^FS

^FO265,115^AR,10,10^FDFILTER, LUBE OIL.^FS
^FO265,715^AR,10,10^FDMove Order^FS
^FO335,955^AR,10,10^FDP2212J13 L7044 GSI W/ESM & AFR^FS

More details on how to write codes using ZPL can be found in the website of zebra
The output of the above code is shown below.


Diego said...

Hi Suresh!
Can I validate a Flexfield? I have a Flexfield that holds the barcode of the products, and I want to validade this so the user can´t type the same barcode twice.

Thanks and congratulations for the nice blog, it helps me a lot.

Suresh Vaishya said...

How are you storing bar code in the attribute field.
Do you mean to say that you have item number in one of the attribute and need to display this value conditionally.

Thomas said...

Hi Suresh,
We have a requirement to print barcode lables through Zebra printer.We are running in Sun solaris system and will ZPL will work in Sun Solaris system?

Suresh Vaishya said...

As discussed in the post you can achieve that using either the ZPL language or the method discussed.

Luca Gualtieri said...

Hi Mr. Vaishya, i'm developing oracle forms on my ERP system to print serial number LABEL with barcodes.
I have a little problem:
I cannot find a solution (ZPL command) to center a barcode on LABEL. There's any ZPL command i could use?

Suresh Vaishya said...

Luca, I dont have Zebra printer anymore as I had done this with one of my previous clients. I will still try to find out and let you know if I know anything.


Saravanan (Saro) said...

Hi Vaishya,

My client buy material from his supplier and stock it to main Warehouse, then distribute the material to Level 1 Organization (Wholesale stores). Level 1 Org (Wholesale Stores), distribute the material to Level 2 (Retail Stores) and then to customers.

My client wants to track all the materials through Barcoding from .

Please let me know at what stage we can generate Barcoding/RFID and what would be the procedure to generate Barcoding/RFID?

Kindly let me know in detail.

Suresh Vaishya said...

How do you transact item from Level1 ORg to Level2 Org and at what stages you are printing a report.

If this is being done using a scanning process then you would need barcode at each stage for Item, source org, source subinv, dest org and dest subinv. Also locators if item is locator controlled in the respective subinventory.


LIO said...

Hi Suresh,
I have a oracle report made with ZPL.When I print to a file and later to the Zebra printer it works. But if I print directly to the printer it doesn't work.
What I'm doing wrong ?
Please, help me.
Luís Horta

Suresh Vaishya said...

We had similar problem when I was building one of the barcode report to be printed on Zebra printer directly from oracle applications.
The alternate solution that we approached is discussed in this post.

An-India said...


We are trying to print a label created with oracle 6i. It doesn't contain any barcodes. But when we send the output to print in Zebra printer it prints with very small fonts and all the data comes at the top left corner of the page. After reading ur blog i was wondering to take the zpl method but couldn't understand how to integrate that with Oracle SRS and print through unix. Can you provide some help?


Suresh Vaishya said...

How does your report look when you view in the output. Is it a text report or PDF report?

Create a PDF report, if output contains only text then that should just work fine.

Danny Tan said...

Thanks Suresh, this site is really useful for me.

arvind kumar said...

Hello Suresh,

The barcode labels that we print on our Zebra Printer using Oracle BI Publisher are not readable by the scanner.

The same barcode labels printed using OPTIO software are getting read by the scanner.

What are we missing?

Anonymous said...


Zebra printers were purchased by one of customer and thought of going ahead with ZPL for Label generation. Just thought of knowing is there any license cost involved for usage of ZPL.Hope since Printers were purchased ,separate licenses were not required to buy.Do u have any idea on this


Sweet Fairy said...

This is great. I need a printer for my Plastic card printing purpose.

Anonymous said...

Thanks for the detailed and informative explanation and example of how to print a Barcode using ZPL.

I still don't see exactly what ZPL command actually triggers the Barcode, but I will find out after I review the ZPL commands, I'm sure.


Sudheer said...


Can you explain me the complete steps for zebra printer configuration in oracle apps 11i.

I have a similar requirement to print barcode labels directly from oracle concurrent program.


Angelo DelaCruz said...

Hi I just want to ask if is it possible to align barcode automatically base on character length?or can i use field block in barcode?if yes how can i do it?



Justbcos2pplfellinlove said...

Dear Suresh,

I'm not sure if you will see this message or not. We are trying to print labels from Oracle to a Zebra printer using ZPL language. Only problem is it is printing the zpl code and not the intended labels. Did you come across such an issue and if so what could be the problem?
Please advise.

Thank You,

Justbcos2pplfellinlove said...

Dear Suresh,

I'm not sure if you will see this message or not. We are trying to print labels from Oracle to a Zebra printer using ZPL language. Only problem is it is printing the zpl code and not the intended labels. Did you come across such an issue and if so what could be the problem?
Please advise.

Thank You,

impresora de etiquetas zebra said...

Best printer ever!

Anonymous said...

i am using oracle application express, i have created one sample applications. i have created the envirionment on the, and my details are below;






i have the print button, but i don't know how to code so the particular row's barcode is sent to printer.
i have oracle forum thread for it,

Kindly look into it and let me know if you could give some guidance

Muhammad Idrees.

Dssil Printers said...

Your blog is much effective and thanks for sharing information
DSSIL is a leading System Integration Service Provider renowned for its services in the field of AIDC Bar Coding and RFID technologies

theft control systems for garments

barcode dealers in hyderabad

thermal receipt printer dealers in hyderabad

theft control systems for garments in hyderabad

barcode dealers in vizag

id card printer machine dealers in vizag

barcode label dealers in vizag

barcode color ribbon dealers

Jihad A G said...

I had a problem with this below coding, not able make equip_id in the second line,
now both coming in the same line
anybody please help to sort this


Copyright (c) All rights reserved. Presented by Suresh Vaishya