Bundled Barcodes Batman
By Tim Dexter on Jul 08, 2010
Sorry, ran out of B's for my alliteration. Hope those of you on this side of the pond enjoyed the fourth. We had our town's celebration on Monday. Organized by my wife, who is an Englisher, the irony was lost on most folks. Still the Renaissance Festival's elephants were a hit and they did not eat the park tress. The water slide turned into a mud bath which went down well with hte kids until we hosed them off with snow melt water :) I spent my day making cotton candy (candy floss) for the kids. If I never have to make it again, it will be too soon. It gets everywhere, quite an ingenious machine thou.
As many of you may have noticed, there are 3 barcode fonts bundled with BI Publisher these daze.
|Font file||Supported algorithms(barcode_type)|
|128R00.TTF||code128a, code128b and code128c|
Thats all well and good but for the likes of the code128 you need to encode your data prior to applying the font. That means some custom java code for you to write and maintain :(
Custom code, pah! No longer needed as the boys and gals in dev are now supplying a java encoding library for the delivered fonts. Big kudos and thanks to Tomoji and Kenneth for 1. putting the solution together and 2. writing it up! You need to be on at least 10.1.3.4.1 to get the library. Once you have it, life could not be much simpler to use the barcodes.
1. Insert a field, and setup the code in properties with <?format-barcode:data;'barcode_type'?> command in the RTF template. You don't need to register any java program because it's already integrated, but you need make sure the font file exist in the font directory.
2. Configure the font correctly in the config file or BIP enterprise UI. Hit the books for this step, its all there in grayscale glory.
Once configured or if you want to test the font on the template builder, here's an example cfg file for UPC font:
<config version="1.0.0" xmlns="http://xmlns.oracle.com/oxp/config/"> <!-- Properties --> <properties> </properties> <!-- Font setting --> <fonts> <font family="Bookman" style="normal" weight="normal"> <truetype path="C:\WINDOWS\Fonts\UPCR00.TTF"/> </font> </fonts> </config>
- Please note that for the Template Builder for Word, Microsoft Word require the fonts exist in the system font directory (e.g. C:\WINDOWS\Fonts) and you need to set up the configuration as above
- There is a known bug exist in Microsoft Word, if you save the template after setting a field with a barcode font, the code will become non-readable after you close and re-open. To avoid such case, set a different font (e.g. Bookman) to the form field in MS Word and map it to the actual font file in the configuration.
<font family="Bookman" style="normal" weight="normal"> <truetype path="C:\WINDOWS\Fonts\UPCR00.TTF"/> </font>
This is neat work around for an issue that I hit all too often.
- upca accept only UPC-A message string and encode into UPC-A barcode
- string of 12 character length will be treated as UPC-A message with a check digit, 11 will be without check digit
- upce accept only UPC-E message string and encode into UPC-E barcode
- string of 8 character length will be treated as UPC-E message with both front and end guard bar, 6 will be without
- we always re-calculate the check digit on both UPC-A and UPC-E output
I know, I know, 11g was announced yesterday and Im late to the party. There are some very neat new features coming and I have a favorite that is going to make building data models a breeze ... more soon!