1751710 Members
5128 Online
108781 Solutions
New Discussion

Re: Barcode Printing

 
Ritu_CRIS
New Member

Barcode Printing

Hi,

 

I want to generate and print barcode through C program on Open VMS. Can anyone help...

Through a sample program downloaded from net i am able to generate bitmap of barcode in 128-C format. How do i send this bitmap to printer for printing the image?

5 REPLIES 5
Tom Wetty
Advisor

Re: Barcode Printing

I usually write these escape codes to a file which are then printed to designated printer. 

Ritu_CRIS
New Member

Re: Barcode Printing

Could you please share the escape sequences for the same

Tom Wetty
Advisor

Re: Barcode Printing

Sorry I do not understand what you mean by share and the data files generated by my work do not belong to me personally.  

 

The escape sequences to generate bar codes, are dependent upon the end-user printing device and are not the same for every printer manufacturer or language the printer supports.  Some printers require unreadable ASCII values, stored in a single byte, others are free text, etc.

 

For the correct escape sequences consult the printer manufacturer's programming reference guide and configuration of your printer.  Usually the manufacturer will provide test text data in a diagram in the manual.

 

Then you use the OpenVMS editor to recreate these string variables in your program that will tell the printer to print a bar code in a paticular format/size, in additon you enter the value(s) which your program generates which is unique to each bar code,  and  then write them to a file. 

 

Usually, I duplicate the test data file in the program, with the correct bar code formatting from the printer's reference guide, found on the internet from the manufacturer's web site.

 

 

Hoff
Honored Contributor

Re: Barcode Printing

There are a wide variety of bar codes and barcode printers, and many differences exist.  How this all works and which escape and control sequences, or PCL or Postscript, or whatever else is needed by the barcode printer varies.  Widely.

 

The answer here also depends on how familiar you are with VMS and C, and with using either printf or $qio[w] I/O calls, as well.

 

Also on whether the printer is attached to a terminal, some random serial port, or connected via the network.

 

Without more details, there's nothing more than a generic answer feasible — one such as this generic reply.

 

If you are seeking an example of some C code that deals with printers and escape sequences, then here is an example program I wrote a while back.   This program queries an attached printer, which may or may not be the case here, but it is (was) a common printing with classic VT terminals.

 

If it's not an attached printer but rather an IP-connected printer involved, read this, and expect to be setting up a reverse telnet connection, and performing I/O with that printer via a channel opened to the TN device.

 

If you're not familiar with programming in C on VMS in general — no offense intended, I do not know your experience and familiarity here — then see an example OpenVMS C hello world, and here are some of the OpenVMS wrinkles C programmers will usually need to know.

 

If you want the C code necessary here either reviewed or possibly even written for you, please post the URL of the C code that you are working from, the specific identification of the printer vendor and model involved, and the applicable project specification.   (Posting a P.O. number will definitely help expedite things, if you're in a hurry.) 

Brad McCusker
Respected Contributor

Re: Barcode Printing

I used to port a barcode program to OpenVMS during a UNIX porting seminar I used to teach at DECUS and such.  Check out http://www.gnu.org/software/barcode for a program that will create postscript output.

 

If postscript won't work for you, then, you need to identify what kind of output you want and find a program that creates that output.  It should be rather straightforward to port it to VMS if it's not already ported.

 

You might also want to check out this discussion from a couple years ago in these very same comunities:  http://h30499.www3.hp.com/t5/Languages-and-Scripting/Need-help-using-PCL-to-print-barcode/td-p/4741734#.VAo0AxbCtJ0

 

 

Brad McCusker

Software Concepts International

www.sciinc.com

Brad McCusker
Software Concepts International