
![]() ![]() ![]() | Tip: Bookmark this page with Ctrl-D (Win) or Apple-D (Mac) | Main • Products • Know How / FAQ • Download • Store • Contact |
Manual - Macintosh Dynamic Library Code 128 / 128 GS1 (C, Cocoa)
IntroductionThe Dynamic Library Code 128 for Mac OS X creates the barcode symbologies Code 128 and Code 128 GS1 (formerly 128 UCC / EAN).
Features
- Full support for all Code 128 variants (A, B, C) with fully automatic variant selection
- Can be used form Objective-C (Cocoa) or from standard C
- Automatic checksum calculation
- Automatic Code 128 GS1 formatting incl. field delimiter for variable fields
- Highly customizable with user definable properties for module width, height, human readable text etc.
- Easy to use - create and display a barcode with only three lines of code
- Sample projects in C and Objective-C
- Control-internal bitpattern routines are accessible from the client for owner drawn barcodes.
- Universal Binary
- Small footprint, only 88 kB, only a single file
OS X 10.4 ("Tiger") or higher. The provided samples require Xcode 2.x or higher; however, the library as such will also work with older Xcode versions. Non-Cocoa projects that use the library must be linked against the ApplicationServices framework. For use in OS versions before 10.4 we offer the source code of the library for a nominal fee so that you can compile the library against the Jaguar or Panther SDKs. See the online store for more info.
Demo / Purchasing
A demo is available; it prints the text DEMO near the barcode, see the download area. Please see the online store for licensing options and pricing.
Installation and Setup
1. In the archive locate the file libcode128.x.y.dylib. Copy this file into /usr/local/lib (you may be prompted for your administrator password).
2. In the archive locate the file WSDYx.h. Copy this file into /usr/include (you may be prompted for your administrator password) or any other directory that's in your include path. You can also copy the file into the home directory of the project that uses the library.
For a quick start see the sample projects: We provide a plain C command line tool sample and an Objective-C sample based on the Cocoa document architecture.
Where to go from here
We've provided two ready-to-compile sample projects, one in C (a command line tool), the other one in Objective-C (a Cocoa document-based application). You find the samples in the folders C-Sample and Cocoa-Sample, respectively, in the archive folder.
The command-line tool creates a barcode and saves it to a file in the /tmp directory. This sample is a good starting point if you have to batch create barcodes. The Cocoa sample looks like this:

We provide a walkthrough for both samples:
Code 128 Dynamic Library Sample Projects
Make sure to also see the reference section of the manual.