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.
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
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.
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.
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.
Tim
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
Thanks for sharing.
Hi,
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.
Tim,
Thanks for the article. I am trying to get the 2dBarcodes (DataMatrix) to work in Oracle Apps 11.5.10.2 and BI Publisher 10.1.3.4.1.
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.
Regards,
Venkat
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.
Regards,
Pradeep.
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
Tim
Hi Tim,
I am trying to use IDAutomationHC39M font. It shows up, but it is very large and I cannot adjust it down and our scanner won't pick it up. Any suggestions?
Thanks,
Arlene
The font sized used in the RTF template should be being respected in the final output. It might be worth creating a new template with just the bar code so you can test it. Something may have gotten corrupted in the template.