Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a 2D Datamatrix barcode. 1

Status
Not open for further replies.

meridian22153

Programmer
Mar 27, 2008
4
0
0
US
I'm trying to create a call program that returns a PCL ascii format to print a 2d datamatrix barcode....Can someone point me out to a some type of directions or informations on how to do this?
 
It was indeed a good start but this site is more of like a software that converts text into a 2D datamatrix format by clicking and dragging or cut and paste. I want to start from scratch....Like how do i convert "A" into a 2D datamatrix format kinda thing....again thanks.....
 
What you need are the technical specifications for a 2d datamatrix barcode. (I would not call a 2d code a barcode myself. Maybe a "spot code"?) I have the COBOL code to create a CODE-39 barcode, which is of course much simpler. Given the specifications for the 2d code, that COBOL code could be used as a starting basis for what you want.
 
After looking at the link glenn gave, it appears that the pcl would have to include raster graphics. Raster graphics pcl cannot be expressed in pure ascii. The actual data must be given in binary format.

There are also the question of how much and what type of data is to be included in each matrix. If the routines noted in that link are used, an encoding scheme must also be chosen.

I suppose one could look at the patent to get the specifications for the code, but why not call some of the supplied routines?
 
Actually, ISO/IEC16022—International Symbology Specification, Data Matrix can be acquired for a couple hundred Swiss francs.

Another approach to this would be create an XML document and use something like barcode4j and Apache FOP, both available in the open source arena, to create a PCL (or PDF) document. Without knowing more about the actual application requirement, it is difficult to recommend a solution.

Tom Morrison
 
This is more for Printnet T & Crystal reports apps. Not really sure if it makes a big difference as far as converting it. I know Printnet T handles XML documents. The thing with that is, I have no clue where to start, how to start and don't even know what it looks like. I'm familiar with code128,postnet and code39 but not datamatrix....
 
Let me restate your requirements to see that I've got it:

Using Micro Focus COBOL under Windows XP, given a string of text, you want to call a subroutine that will return the PCL that you can send to a printer (HP or clone) that will print that string of text as a Datamatrix 2D code.

Is this correct? Also, would an algorithm written in Micro Focus COBOL to generate the PCL be an adaquate substitute for the subroutine?
 
Here is an open source barcode producing application implemented in Java. It consumes a relatively simple XML document and produces DataMatrix barcodes (among others), encoded as another XML document, called SVG. It is also capable of producing other graphics formats, but does not directly produce PCL.

To get PCL, one could embed the SVG inside another XML document called XSL Formatting Objects (XSL-FO). XSL-FO can then be rendered as PDF, PCL, and several other formats using a Formatting Object Processor, and example of which is Apache FOP (Google it).

DataMatrix is quite complicated when compared to PostNet, 4-state, EAN/UPC, Code 128, etc, since it is a two dimensional code.

You could do a couple things with this information.

1. You could decide to write a very simple XML document using line sequential and process it through barcode4j and Apache FOP, and 'inhale' the resulting PCL, or ...

2. You could use the open source barcode4j as a template for an algorithm to be reimplemented in COBOL. After all, the algorithm is merely deciding where to draw rectangles. If you are fluent with PCL, this might work.

Too bad you are not using a different COBOL, where this could be done in three or four lines of procedure code!

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top