Discussion:
I need to print bar codes
David Shere
2007-02-28 16:09:31 UTC
Permalink
I need to print bar codes with ofbiz. Can someone point me in the right
direction? Is there an ofbiz consulting company that might be able to
help me? I need to know objects to use, services to call, etc. It
seems likely that someone has done this already with ofbiz.
--
David Shere
Information Technology Services
Steele Rubber Products
www.SteeleRubber.com
Ray Barlow
2007-02-28 16:36:59 UTC
Permalink
There are a few samples around the code base like pick lists and POS
till receipts. A more recent very simple entry can be found when editing
a product in the catalogue application, just below the buttons for the
different product tabs and the new product image you should see a button
labelled "Barcode". Click it and a pdf screen will show you the barcode
for that product code.

Ray
Post by David Shere
I need to print bar codes with ofbiz. Can someone point me in the
right direction? Is there an ofbiz consulting company that might be
able to help me? I need to know objects to use, services to call,
etc. It seems likely that someone has done this already with ofbiz.
Jacques Le Roux
2007-02-28 16:36:38 UTC
Permalink
David,

Edit a product from the catalogue. You see there is "Barcode" link for
the product. I guess you will find enough from there.

An example link :
https://demo.hotwaxmedia.com/catalog/control/ProductBarCode.pdf?productId=WG-9943&productName=Giant%20Widget
(needs to connect as admin/ofbiz)

Jacques
Post by David Shere
I need to print bar codes with ofbiz. Can someone point me in the right
direction? Is there an ofbiz consulting company that might be able to
help me? I need to know objects to use, services to call, etc. It
seems likely that someone has done this already with ofbiz.
--
David Shere
Information Technology Services
Steele Rubber Products
www.SteeleRubber.com
Jacques Le Roux
2007-02-28 16:36:38 UTC
Permalink
David,

Edit a product from the catalogue. You see there is "Barcode" link for
the product. I guess you will find enough from there.

An example link :
https://demo.hotwaxmedia.com/catalog/control/ProductBarCode.pdf?productId=WG-9943&productName=Giant%20Widget
(needs to connect as admin/ofbiz)

Jacques
Post by David Shere
I need to print bar codes with ofbiz. Can someone point me in the right
direction? Is there an ofbiz consulting company that might be able to
help me? I need to know objects to use, services to call, etc. It
seems likely that someone has done this already with ofbiz.
--
David Shere
Information Technology Services
Steele Rubber Products
www.SteeleRubber.com
Walter Vaughan
2007-02-28 19:07:45 UTC
Permalink
Post by David Shere
I need to print bar codes with ofbiz. Can someone point me in the right
direction? Is there an ofbiz consulting company that might be able to
help me? I need to know objects to use, services to call, etc. It
seems likely that someone has done this already with ofbiz.
What I had asked David about was a means to print barcodes on barcode
printers using native Zebra EPL/2 control codes to a named print spool,
not printing a barcode on a pdf.

||||||||
Simple samples of what gets transmitted.
https://support.zebra.com/cpws/docs/eltron/common/epl2_samp.htm

||||||||
Here is a working code to print to Zebra printer that I found on a website.
<quote>
Printer name should contain keyword "zebra", printer could be local or on network.

public void testZebra() {
try {
PrintService psZebra = null;
String sPrinterName = null;
PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
for (int i = 0; i < services.length; i++) {
PrintServiceAttribute attr = services.getAttribute(PrinterName.class);
sPrinterName = ((PrinterName)attr).getValue();
if (sPrinterName.toLowerCase().indexOf("zebra") >= 0) {
psZebra = services;
break;
}
}
if (psZebra == null) {
System.out.println("Zebra printer is not found.");
return;
}
System.out.println("Found printer: " + sPrinterName);
DocPrintJob job = psZebra.createPrintJob();

//String s = "^XA^FO5,40^BY3^B3,,30^FD123ABC^XZ"; // good
String s = "^XA\n^FO5,40^BY3^B3,,\n30^FD123ABC\n^XZ"; // '\n' does not hurt
byte[] by = s.getBytes();
DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
// MIME type = "application/octet-stream",
// print data representation class name = "[B" (byte array).
Doc doc = new SimpleDoc(by, flavor, null);
job.print(doc, null);
} catch (PrintException e) {
e.printStackTrace();
}
} // testZebra()

</quote>
||||||||

Does any of this ring a bell to anyone?
Done anything like this in the past?
Could any of this be used with ofBiz?

--
Walter
Jacques Le Roux
2007-02-28 19:39:59 UTC
Permalink
AFAIK, There is nothing like that in OFBiz yet. Seems not related to
EPL/2 (did not find any Zebra or EPL/2 in the site) but you may also
have a look to : http://barcode4j.krysalis.org/

Jacques

----- Original Message -----
From: "Walter Vaughan" <***@steelerubber.com>
To: <***@ofbiz.apache.org>
Sent: Wednesday, February 28, 2007 8:07 PM
Subject: Re: I need to print bar codes
Post by Walter Vaughan
Post by David Shere
I need to print bar codes with ofbiz. Can someone point me in the right
direction? Is there an ofbiz consulting company that might be able to
help me? I need to know objects to use, services to call, etc. It
seems likely that someone has done this already with ofbiz.
What I had asked David about was a means to print barcodes on barcode
printers using native Zebra EPL/2 control codes to a named print spool,
not printing a barcode on a pdf.
||||||||
Simple samples of what gets transmitted.
https://support.zebra.com/cpws/docs/eltron/common/epl2_samp.htm
||||||||
Here is a working code to print to Zebra printer that I found on a website.
<quote>
Printer name should contain keyword "zebra", printer could be local or on network.
public void testZebra() {
try {
PrintService psZebra = null;
String sPrinterName = null;
PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
for (int i = 0; i < services.length; i++) {
PrintServiceAttribute attr = services.getAttribute(PrinterName.class);
sPrinterName = ((PrinterName)attr).getValue();
if (sPrinterName.toLowerCase().indexOf("zebra") >= 0) {
psZebra = services;
break;
}
}
if (psZebra == null) {
System.out.println("Zebra printer is not found.");
return;
}
System.out.println("Found printer: " + sPrinterName);
DocPrintJob job = psZebra.createPrintJob();
//String s = "^XA^FO5,40^BY3^B3,,30^FD123ABC^XZ"; // good
String s = "^XA\n^FO5,40^BY3^B3,,\n30^FD123ABC\n^XZ"; // '\n' does not hurt
byte[] by = s.getBytes();
DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
// MIME type = "application/octet-stream",
// print data representation class name = "[B" (byte array).
Doc doc = new SimpleDoc(by, flavor, null);
job.print(doc, null);
} catch (PrintException e) {
e.printStackTrace();
}
} // testZebra()
</quote>
||||||||
Does any of this ring a bell to anyone?
Done anything like this in the past?
Could any of this be used with ofBiz?
--
Walter
Loading...