Ben
|
Best Answer
TOOLS AND REQUIREMENTS
• QR Code Font and Encoder 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 purchase from the IDAutomation store and extract the IDAutomation_QRCodeFontEncoder.zip.
2. To install the IDAutomation2D font, run the IDAutomation_QRCodeFontEncoder.exe or manually install the font located :
OPTION 1 Install using EXE
OPTION 2 Manually install Fonts

Set up class
3. Download and install the QR Code Developer Tools from the IDAutomation store and extract the IDAutomation_QRCode_Developer_Tools.zip.
4. Locate the IDAutomation_QRCode_JavaFontEncoder_QRCode.jar and set up the jar file in your Java environment.

=============================================================================
CREATE BARCODEUTIL.CLASS
5. Access Tim Dexter's BarcodeUtil.java file available in (2DBarcode - src - oracle - psbi - barcode).
6. Because the Quick Quips tutorial was created in 2012, the BarcodeUtil.java available in Tim's article has a few outdated parameters. The Encoder section of the tutorial provides an example of the parameters. Open the BarcodeUtil.java file and verify that it is updated to this:
QRCodeEncoder qre = new QRCodeEncoder();
boolean ApplyTilde = false;
String EncodingMode = "Byte";
int Version = 0;
String ErrorCorrectionLevel = "M";
boolean BestMask = false;
return qre.FontEncode(DataToEncode, ApplyTilde, EncodingMode,
ErrorCorrectionLevel,Version,BestMask);
7. Within the BarcodeUtil.java file, include an encoder call to the IDAutomation_QRCode_JavaFontEncoder_QRCode.jar :
Class[] clazz = new Class[] { "".getClass() };
//ENCODERS.put("code128a",mUtility.getClass().getMethod("code128a", clazz));
//ENCODERS.put("code128b",mUtility.getClass().getMethod("code128b", clazz));
//ENCODERS.put("code128c",mUtility.getClass().getMethod("code128c", clazz));
ENCODERS.put("qrcode",mUtility.getClass().getMethod("qrcode", clazz));
This entry will register the encoder method.
8. Verify the IDAutomation_QRCode_JavaFontEncoder_QRCode.jar is in the classpath.
9. There are also additional jar files required from
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. Based on the tutorial, 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, 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.
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_JavaFontEncoder_QRCode.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:
and add a font entry for the IDAutomation2D.ttf.

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'?>

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

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


18. Return to the project and select the IDAutomation2D font from the font list. View the document.
Posted 2.5 year(s) ago
|