Komumaldata Barcoded PDF Forms PDF417 Barcode Generator Reference XFA (LiveCycle) Version Generator Version: 1.12
Table of contents PDF417 Barcode Structure...3 Generator Function...3 Text Encoding Object...4 Examples...5 Embending Javascript...5 Contact...6 ii.
PDF417 Barcode Structure Generator Function Description Calling the Komdat_GeneratePDF417() function will generate the barcode symbol. Note that the function does not correct invalid parameter values, thus, you must supply valid parameters! Important technical informations are detailed in the descriptions of the parameters, except for barcode symbol coloring. Barcode graphic colors are hard-coded as black-white, and should not be changed. Colored barcodes can be read too, because all barcode readers are colorblind and analize contrast. This also explains why the black-white pair is the most safe combination to use. Parameters 1. Input Data: Must be an array, containing single byte elements, wich are the character codes of the data to encode. 2. Error Correction Level: There are a total of nine error detection/correction levels available, from zero to eight. Encoding with a correction level of zero does not mean that there are no error detection/correction codewords. Higher level means larger symbol size, longer calculation time, higher chance of detecting and correcting an error. 3. Number of Columns: The number of data columns can be fixed by giving an integer of a value between and including one and thirty. The generator algorithm calculates the optimal number of data columns automatically, if the value of the parameter is zero. 4. Number of Rows: The number of rows can be fixed by giving an integer of a value between and including three and ninety. The generator algorithm calculates the optimal number of rows automatically, if the value of the parameter is zero. 3.
If booth the number of data columns and rows are specified, the given number of rows is ignored, and the needed row count is calculated. 5. Container Object Reference: The container for the barcode symbol is an image field object, wich displays the symbol as a raster graphic bitmap. Note that XFA (LiveCycle) forms do not support vector graphics at all. Must be a string containing a valid reference to an image field object, wich is obtained using the resolvenode() function. 6. Quiet Zone Size: The minimum suggested size of the quiet zone is two times the size of the X dimension. The size of the X dimension is one unit. There is no need for a quiet zone, if the barcode is not surrounded with text, graphic or different background. 7. Y Dimension Size: The size of the Y dimension, given in units. The suggested size of the y dimension is 3 times the size of the X dimension. Must be between and including two and five. 8. Scale: The width and height of the barcode symbol container are multiplied with this value to scale the symbol. The sizing of the barcode symbol depends on booth the parameter values of the generator and the configuration of the container object. The generator only changes the size, any other setting of the container object must be configured manually. This is because we wanted developers to have more option displaying the barcode symbol. In static LiveCycle forms objects can not be resized dynamicly (that is why the form is called static), therefore resizing the symbol in static forms is not possible. 9. Maximum Symbol Width: 10. Maximum Symbol Height: These parameters specify the maximum size of the container object that displays the barcode symbol. This ensures that the generated symbol will not take more place than it should. Giving zero as the value of these parameters means there is no size restriction. The value is measured in inches, for compatibility with LiveCycle designer. 11. No Symbol Sizing: When set to true, it turns automatic sizing off. This affects the following parameters: Scale Maximum Symbol Width Maximum Symbol Height Throws Symbol too large! error if the encoded data takes more than 925 data codewords. Text Encoding Object Description This object provides functionality for converting codetable on a PDF internal string. All functions have one single parameter, wich is an internal string, and all of them return with an array of byte wide integer numbers. The array returned by these functions can be supplied as the input data parameter of the generator function without any further conversion needed. Note that the barcode encoding and decoding system must be set to the same character encoding to maintain integrity of the carried data. Characters that are not present in the choosen codetable are replaced with a non-breaking space. Functions objencoding.uni_to_8859_1(string) - Converts to iso-8859-1 codetable. objencoding.uni_to_8859_2(string) - Converts to iso-8859-2 codetable. objencoding.uni_to_8859_5(string) - Converts to iso-8859-5 codetable. objencoding.uni_to_8859_6(string) - Converts to iso-8859-6 codetable. objencoding.uni_to_8859_7(string) - Converts to iso-8859-7 codetable. objencoding.uni_to_8859_8(string) - Converts to iso-8859-8 codetable. objencoding.uni_to_8859_15(string) - Converts to iso-8859-15 codetable. 4.
objencoding.uni_to_8859_16(string) - Converts to iso-8859-16 codetable. objencoding.uni_encode(string) - Breaks up large character codes to unicode byte sequences. Examples Running the generator script Step 1: Get the data to encode, wich is the string value of a text field object in this example. Step 2: Convert the string to an array of byte wide integers, wich are character codes from a specified codetable. Step 3: Generate the barcode symbol. Advice: We advise you to put the barcode generator function call into a try block. An exception is thrown: When the encoded data size exceeds 925 data codewords, wich is the maximum specified in the PDF417 standard. When an invalid parameter value causes an error. (There is no parameter validation!) The generator is tested and working, and will not encounter any error other than too much input data, if the parameter values are valid. var TextData = new String(form1.page1.TextInputField.rawValue); var ChrBlock = EncodingFunctions.objEncoding.Uni_To_8859_1(TextData); try { Step 1 Step 2 KomdatBarcodeGenerator.Komdat_GeneratePDF417(ChrBlock, 2, 0, 0, "xfa.form.form1.page1.barcodesymbolimage", 4, 3, 0.7, 5.1875, 2.5, false); Step 3 } catch(errormsg) { xfa.host.messagebox(errormsg.tostring()); } Advice Do not forget, that you must reference the functions through the scripting object, that contains them! Configuring the barcode symbol Example 1: How to make a barcode symbol wich resizes automatically, proportionally and uses a zoom multiplier? Set the sizing property of the image field object to scale image proportionally. Turn on automatic sizing by setting the no symbol sizing parameter of the generator function call to false. Set the parameters of the automatic sizing. Example 2: How to make a barcode symbol wich always takes the same size independent from the ammout of the carried data? Set the sizing property of the image field object to scale image to fit rectangle. Turn off automatic sizing by setting the no symbol sizing parameter of the generator function call to true. Note that this might corrupt your barcode symbol, if the width to height ratio of the image field differs greatly from the generated picture s. This can be corrected by fixing the number of data columns or rows. Embending Javascript To embend the generator code in your LiveCycle PDF form, follow these steps: Open your document with LiveCycle designer. Right click the form in the hierarchy veiw, and select Insert Script Object form the dropdown menu. Name the new scripting object as KomdatBarcodeGenerator. Select the scripting object, and open up a script editor window (Ctrl+Shift+F5). Copy the contents of the Komdat_PDF417_XFA.txt provided in the package, into the scripting object. Add an other scripting object, and name it EncodingFunctions. Copy the contents of the EncodingFunctions.txt into the scripting object. Create and configure the image field that will display the barcode. (See examples section.) Call the functions to generate the barcode. (See examples section.) 5.
Contact Visit our website for news and releases: http://barcodedpdfforms.com Mail us with technological questions: support@barcodedpdfforms.com With any other non-technological question, you can mail us at: info@barcodedpdfforms.com 6.