New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions Bookmark and Share

How to create 1D Barcodes in BI Publisher


What are the requirements and steps to create barcodes in BI Publisher? I have read Tim Dexter's Advanced Barcode Support but I do not understand it.

This post is based on of Tim Dexter's Advanced Barcode Support article. We'll list the product requirements, steps, and provide compatibility information. In order to produce barcodes in the BI Publisher solution, the user/developer must use a combination of the (1) IDAutomation class/jar, (2) IDAutomation barcode fonts, (3) jar files included with BI Publisher, and (4) a java file compiled to a wrapper class.

1D Barcodes include:
Code 128
Code 39
Code 93
Databar
Intelligent Mail Barcode (IMB)
Interleaved 2 of 5
MSI
Universal Fonts
UPC and EAN


Application: BI Publisher, Word

10-14-20     52 day(s) ago    

  Report Abuse

 

Ben

Best Answer

TOOLS AND REQUIREMENTS

• 1D Barcode Font Package (Developer License and up)
• BI Publisher
Microsoft Word
• BarcodeUtil.java file. Download an example from Tim Dexter's article.
• Collection of Jar files from the jlib folder of the BI Publisher Desktop install.

=============================================================================
INSTALLATION

Install all required applications and components for Word and BI Publisher.

1. Download the demo or purchased version of the 1D barcode fonts package. Extract the file and run the installer OR manually install the fonts by referring to your OS instructions for installing a font.

2. Download the Java Font Encoder Class demo or extract the encoder from the Developer Tools download from the store purchase.
image
NOTE:

Set up class

3. Set up the IDAutomation_LinearJavaFontEncoder.jar in your environment.
image
=============================================================================

CREATE BARCODEUTIL.CLASS

4. Download and access Tim Dexter's BarcodeUtil.java file available in (2DBarcode - src - oracle - psbi - barcode). In the Advanced Barcode article, Tim uses source code. I believe you will need take a different approach since our encoder is maintained in a class and jar. NOTE: You will see references to a 2DBarcode folder and a QR Code method call in the BarcodeUtil.java. This is okay. If you are creating 1D barcodes, simply remove it. Remove the three code 128 functions as well since we will be using the IDAutomation jar instead.

5. In the BarcodeUtil.java, remove these functions:
public static final String code128a(String s) {code}
public static final String code128b(String s) {code}
public static final String code128c(String s) {code}

6. Each barcode type includes its own parameters which are available here. You'll need to set these prior to compiling the class. If you need to modify parameters, a new class needs to be compiled. Within the BarcodeUtil.java file, let's set the parameters for a Code 128 Auto. Other barcode types require different property settings.

import com.idautomation.*;
LinearFontEncoder FontEncoder = new LinearFontEncoder();
boolean ApplyTilde = true;
return FontEncoder.Code128(DataToEncode, ApplyTilde);


7. Within the BarcodeUtil.java file, include an encoder call to the IDAutomation_LinearJavaFontEncoder.jar:

Class[] clazz = new Class[] { "".getClass() };
ENCODERS.put("code128",mUtility.getClass().getMethod("code128", clazz));


This entry will register the encoder method.

8. Verify the IDAutomation_LinearJavaFontEncoder.jar is in the classpath.

9. There are also additional jar files required from image
These files include: xdocore.jar, xmlparserv2.jar, collections.jar, aolj.jar, share.jar, xdoparser.jar, jewt4.jar, 18nAPI_v3.jar
These files should also be placed in the classpath.

10. The new class can be compiled. If there are errors, contact Tim Dexter directly.

11. It is recommended that a new jar is created. In his example from the Quick Quips tutorial , Tim calls set up the Manifest file and includes additional jar. He names the new jar barcodejar.jar. Both the IDAutomation and the newly created jar should be copied to the Template Builder for Word directory.
image

NOTE: STEPS 12 & 13 written by Tim Dexter
12. "The next step is to get the jars into the classpath for the Word plugin so that Publisher can find your wrapper class and it can then find the IDAutomation encoder. The most consistent way I have found so far, is to open up the RTF2PDF.jar in the same directory and make some mods.

First make a backup of the jar file then open it using Winzip or 7zip or similar and get into the META-INF directory. In there is a file, MANIFEST.MF. This contains the classpath for the plugin, open it in an editor and add the jars to the end of the classpath list. In mine I have: "

Manifest-Version: 1.0
Class-Path: ./activation.jar ./mail.jar ./xdochartstyles.jar ./bicmn.jar ./jewt4.jar
./share.jar ./bipres.jar ./xdoparser.jar ./xdocore.jar ./xmlparserv2.jar
./xmlparserv2-904.jar ./i18nAPI_v3.jar ./versioninfo.jar
./barcodejar.jar ./IDAutomation_LinearJavaFontEncoder.jar
Main-Class: RTF2PDF



13. The next step is to reference the font location so that the rendering engine can find it and embed a subset into the PDF output. Remember the other output formats rely on the font being present on the machine that is opening the document. The PDF is the only truly portable format. Open the xdo example.cfg file located:
image

and add a font entry for the IDAutomationC128L.ttf. (or font used).
image

14. Return to Word and access the BI Publisher file. Double-click the field to barcode and choose Add Help Text to open the Form Field.

15. In the Status Bar tab, enter the first command:
<?register-barcode-vendor:'ENCODER WRAPPER CLASS'; 'ENCODER NAME'?>
image

16. In the Help Key (F1), enter the second command:
<?format-barcode:DATA_TO_ENCODE;'ENCODER_METHOD_NAME';'ENCODER_NAME'?>
image

17. To ensure the data is encoded, view the document (PDF,RTF,HTML):
image
image

18. Return to the project and select the IDAutomationC128L font from the font list. View the document.
image

Posted 52 day(s) ago

(0)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.

Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2021 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook