XF Rendering Server 2013 offers support for drawing 128, 128 Raw, 128 UCC, UPC-A, UPC-E, EAN-13, EAN-8, 2 of 5, 3 of 9, Postnet, Planet, OMR, PDF 417, Maxicode and DataMatrix barcodes.
A barcode can be defined as follows:
<xf:barcode xmlns:xf="http://www.ecrion.com/xf/1.0" value="upc code" type="Auto|Code128|Code128Raw|Code128UCC|2of5|3of9|Aztec|DataMatrix|EAN-13|EAN-8|IntelligentMail|Maxicode|OMR|Pdf417|Planet|Postnet|QRBarcode|UPC-A|UPC-E|
bar-unit="length"
include-checksum="boolean"
draw-text="boolean"
extended="boolean"
encoding="ASCII|C40|TEXT|BASE256|NONE|AUTO"
preferred-format="AUTO|C10x10|C12x12|etc."
fo:content-width="length"
fo:content-height="length"
fo:content-scaling="non-uniform|uniform"
fo:font="font"
fo:padding="padding"
fo:border="border"
fo:color="color">
Note:
• | Normal formatting attributes (font, color) still apply, but they must be prefixed by the XSL-FO namespace prefix. |
value:
• | The code value. For EAN and UPC values specified, the value can be specified with or without the check digit (the last digit). If the check digit is specified, then type attribute must be specified as well. |
• | When type is EAN, UPC, 2OF5 or Postnet, non-digit characters in the value are ignored. |
• | When type is 3OF9 non extended, only uppercase A-Z and -. $/+%* are acceptable. |
type:
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
bar-unit:
• | Specifies the length of one unit of the barcode and applies only to UPC and EAN barcodes. Barcode lines can be between "1" and "4" units. |
include-checksum:
• | Specifies if a checksum must be computed for 3 of 9 barcodes. By default, this value is set to "false". |
draw-text:
• | Specifies if the barcode value and the checksum must be displayed for 128, 128 Raw, 128 UCC, 2of5, 3of9, EAN-13, EAN-8, UPC-A and UPC-E barcodes. The default value is "true". |
extended:
• | Allows a wider character set for 3 of 9 barcodes. The default value is "false". |
encoding:
Specifies the encoding for the DataMatrix barcodes. The available values are: "ASCII", "C40", "TEXT", "BASE256", "NONE" and "AUTO".
preferred-format:
Specifies the format for the DataMatrix barcodes. The available values are:
• AUTO |
• C24X24 |
• C64X64 |
• C144X144 |
• C10X10 |
• C26X26 |
• C72X72 |
• C8X18 |
• C12X12 |
• C32X32 |
• C80X80 |
• C8X32 |
• C14X14 |
• C36X36 |
• C88X88 |
• C12X26 |
• C16X16 |
• C40X40 |
• C96X96 |
• C12X36 |
• C18X18 |
• C44X44 |
• C104X104 |
• C16X36 |
• C20X20 |
• C48X48 |
• C120X120 |
• C16X48 |
• C22X22 |
• C52X52 |
• C132X132 |
rotation:
• | value: int |
• | Specifies the rotation angle. |
bar-height:
• | type: float |
• | Specifies the barcode's height. |
dot-size:
• | type: int |
• | Sets the dots per pixel resolution for the PDF417 barcode type. |
scale:
• | type: float |
• | Specifies the scaling factor. |
internal-padding:
• | type: length |
• | Sets the intrinsic barcode padding. |
initial-code-set:
• | type: enum |
• | Specifies the start code set for Code128, Code128Raw and Code128UCC barcode types. |
• | Values: "CodeSetA", "CodeSetB", "CodeSetC" |
bar-spacing:
• | type: length |
• | Specifies the bar spacing for the OMR barcode type. |
bar-length:
• | type: length |
• | Specifies the bar length for the OMR barcode type. |
column-count:
• | type: int |
• | Specifies the column count for PDF417 barcode type. |
row-count:
• | type: int |
• | Specifies the row count for PDF417 barcode type. |
value-type:
• | type: enum |
• | Specifies the output value type. |
• | Values: text, hexa |
micro-qr:
• | type: Boolean |
• | Specifies if the QR barcode type should be displayed as Micro QR. |
primary-data:
• | type: String |
• | Specifies the primary data for Maxicode barcode type. |
maxicode-mode:
• | type: enum |
• | Values: "USCarrier", "InternationalCarrier", "StandardSymbol", "SecureSymbol", "ReaderProgram" |
aztec-size:
• | type: length |
• | Specifies the size for the Aztec barcode type. |
aztec-is-compact:
• | type: Boolean |
• | Specifies if the Aztec barcode type must or must not be compact. |
aztec-auto-correction:
• | type: int |
• | Specifies the correction error for the Aztec barcode type. |
barcode-page-value:
• | it is a "child" element of xf:barcode |
• | it must be used when JavaScript code is utilized for generating the code |
• | attributes: |
xf:page-index |
- Sets the value of a variable's $pageIdx and $sheetIdx when the value attribute of xf:barcode is "javascript" |
xf:document-page-index |
- Sets the values for $documentPageIdx and $documentSheetIdx variables when the value attribute of xf:barcode is "javascript" |
Examples:
1. UPC-A barcode:
<fo:block>
<xf:barcode xmlns:xf="http://www.ecrion.com/xf/1.0" xf:bar-unit="1px" fo:scaling="non-uniform" fo:content-height="50pt" fo:padding="10pt" fo:font="7.5pt Arial" fo:color="blue" xf:type="UPC-A" xf:value="123456789012" xf:draw-text="true" xf:rotation="0"/>
</fo:block>
Output:
2. DATAMATRIX barcode:
<fo:block>
<xf:barcode value="Hello World" type="DATAMATRIX" encoding="ASCII" preferred-format="C20X20"/>
<fo:block/>
Output:
3. Postnet barcode:
<fo:block>
JOE DOE<fo:block/>
101 Main Street<fo:block/>
Anytown US 12345-6789<fo:block/>
<xf:barcode xmlns:xf="http://www.ecrion.com/xf/1.0" xf:type="Postnet" xf:value="12345-678901" xf:draw-text="true" xf:rotation="0" xf:encoding="ASCII" xf:preferred-format="C20X20"/>
</fo:block>
Output: