2D Barcodes Cracked ...

A few weeks back I wrote about the barcode encoding solution thats now available for use with XML Publisher for advanced barcode encoding calculations prior to applying the bar code font to the output. I found some time to take a look at some of the 2D barcodes and their requirements for encoding and rendering. Once you have the encoding class set up in your environment its pretty simple to add the 2D barcode encoding code.

XML Publisher does not yet license fonts for ... they're coming, although no 2D barcodes. So I have been working with the PDF417 and Data Matrix fonts available from IDAutomation, along with the fonts they also provide neat java classes to do all the encoding you need. Its just a case of making their classes available in your environment and calling them in your encoding class. Then with a neat trick in your RTF template et voila you can have funky 2D barcodes in your output.

Step 1: Get the barcodes and encoding classes

So you'll need to license the fonts from the vendor, in this example I worked with the sample fonts available from the IDAutomation site.
PDF417 Font - http://www.advancemeants.com/downloads/IDAutomation_PDF417FontEncoderDEMO.zip - you'll get a zip file with the font and java class plus a bunch of other useful integration tools. All you need is the PDF417Encoder.class and the IDAutomationPDF417nX.ttf font from the AdditionalFonts.zip where 'X' is the X to Y ratio of the font shape, 3 is the standard.

This is explained better on the web site, http://www.idautomation.com/fonts/pdf417/faq.html#Specifications

Step 2: Update your XMLP encoding class

Now you need to add the encoding code to your encoding class, take a look at our entry from a while back on Advanced Barcode Support.
In the encoder class we created we import the font vendors encoding class and add an entry for the pdf417 font
      import IDautomationPDFE.PDF417Encoder;
      ENCODERS.put("pdf417",mUtility.getClass().getMethod("pdf417", clazz));

and create a pdf417 method that just calls the class provided by the font vendor:

  public static final String pdf417( String DataToEncode )
       PDF417Encoder pdfe = new PDF417Encoder();
       return ( pdfe.fontEncode(DataToEncode) );

Compile and deploy to the server as normal.

Step 3: Use the font in your template

Install your font into the <<WINDOWS_HOME>>/fonts directory and fire up MSWord. Create your template and for the data that you wish to use the barcode for:
(a) Use a formfield or raw text
    <?format-barcode:ITEM_DESCRIPTION ;'PDF417';'XMLPBarVendor'?>
where ITEM_DESCRIPTION is the data to be encoded
           PDF417 is the name of the encoding method to be used
           XMLPBarVendor is the name of our encoder
(b) Mark the formfield or text with the PDF417 font
Now save your template and deploy.
Now when you run the template the data will be encoded and the font applied.
I have uploaded a sample encoding class and template to help you out.

The same process can be applied to the Datamatrix barcode to generate that output.  We had a customer test the result of the PDF417 and Datamatrix barcodes and their 2D barcode hardware read the resulting barcodes perfectly.


Hello Tim, We have been trying to implement barcodes in our XML Publisher Reports. We have tried several options but nothing works out. In most cases the scanner is not able to read the barcodes correctly. We had picked up the IDAutomationSC128M.ttf font from their site. If you want I can mail my RTF template to you so that you can have a look at it and let mw know where I am wrong. We want to print Code 128a barcode fonts. Request you to please tell me where can I get this font from, along with the encoder class. For your information, we are the version we have is as below: java -version java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) jre -version Java(tm) Runtime Loader Version 1.1.8 You may get back to me at bulbul.saha@ge.com Can I have your email ID please? Thanks regards Bsaha

Posted by bsaha on July 02, 2006 at 08:14 PM MDT #

Hi Bsaha

The IDAutomation font should be fine ... we have other customers using them successfully. You can send me your template, font and sample data to tim.dexterAToracleDOTcom.


Posted by Tim Dexter on July 13, 2006 at 08:17 AM MDT #

I have been trying to use this on the PC side to test the barcoding and cannot get the new class to 'find' the IDautomation class. What do I need to do to get the class to compile?

Posted by Mike Parr on April 01, 2009 at 09:40 PM MDT #

Hello! I should use pdf417 font on dispatch labels, but I have not got it working properly. The encoder is invoked, but the output of the 2D barcode is not correct. There is horizontal white space in the code. I have allready logged two service requests (last one:3-1075385333) regarding. We are using the code from IDAutomation. Where and how to format the output? Best regards, Lüüli

Posted by Lüüli on November 22, 2009 at 10:37 PM MST #

This is absolutely fantastic :) Thanks for putting this online.

Posted by Thomas Wanner on December 09, 2009 at 03:39 PM MST #

Interesting reading

Posted by kläder online on August 18, 2010 at 05:18 AM MDT #

try going to the lib ray and try an beginners book for her maybe she could try to sound out the words and if the book has her stumped maybe you should read it to her about 3 times and see if she was listening and let her read it on her own.My little cousin likes to read from the pictures.

Posted by Douglass Hoak on September 25, 2010 at 07:57 PM MDT #

Thanks for sharing.

Posted by Olivia on November 20, 2011 at 07:57 PM MST #

Here is another cracking tech to share:
1. Dowload Free Evaluation version from my home page
2.Put it into C# IDEs
Make buttom to generete QR Code using the generator.
3.Press the bottom several times till the water marks disappeared.

Posted by Adam Barlow on November 22, 2011 at 06:00 PM MST #


Thanks for the article. I am trying to get the 2dBarcodes (DataMatrix) to work in Oracle Apps and BI Publisher

I followed the instructions on this blog, installed the DataMatrixEncoder.class under $JAVA_TOP. Created a new java encoding class BarcodeUtil and compiled it under the path 'oracle.apps.xdo.template.rtf.util.barcoder.BarcodeUtil'. I installed the ataMatrix fonts using BI Publisher Administration - fonts and font mappings. I can't seem to get the encoding working.

I wanted to take a look at your Sample file listed on this blog but I can't access it. Is there a place where I can access the sample files you had created as part of this blog to compare with what I am doing.

Thanks in advance.


Posted by Venkat on July 28, 2014 at 03:17 PM MDT #

Hi Tim,

Thanks for your post here. When I spoke to IDAutomation, it seems they are not giving support for XML publisher thing. what can we do if there are any issues in the BI publisher rtf template after buying the license from them?

I tried with demo version by downloading the product from IDAutoamtion and done all the setups in client machine.Will that work forever or do we need to buy the product from them though they do not give support?

Please provide your comments.


Posted by Pradeep on May 08, 2015 at 08:00 AM MDT #

Hi Pradeep

IDAutomation can and should only support their font file and their java encoding class. Oracle supports the BIP implementation of the font. We have documented how to use the font and encoder class to preserve the division of responsibilities btw IDAutomation and Oracle ie do not copy and paste IDAutomation's java code into your class, import it and use the apis.
Hope this clarifies


Posted by Tim on May 08, 2015 at 08:53 AM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!


« June 2016