Barcode Generator Option

Barcode Generator Option enables you to embed barcodes directly in the document as images. Barcode fonts are not necessary.

Customers must purchase "AH Formatter AH Formatter Barcode Generator Option" to generate Barcodes. See also Antenna House website for more details.

Barcode Generator Option supports the following barcode formats.

The barcode can be specified by using data: scheme as follows;

<fo:external-graphic src="data:application/vnd.ah-barcode;type=QR;scale=2,Hello%20World!"/>

application/vnd.ah-barcode is a special media type of its own use. The barcode content you want to output can be specified directly as strings as shown above. Note that at this time, an improper character as URI should be expressed by the % encode. You can also specify it with base64.

<fo:external-graphic src="data:application/vnd.ah-barcode;type=QR;base64,PD94bWwgdmVyc2lv..."/>

The barcode output is controlled by the parameter of the media type. The parameter is not case-sensitive. The type parameter is indispensable and indicates the types of the barcode to output.

The barcode is always enforced by axf:image-smoothing="false".

CAUTION: The specification of the barcode is not dwelled in this document. Please refer to the specification of the associated barcode.

QR / MicroQR

QR sample QR codes comply with the international standard of ISO/IEC 18004:2006. Barcode Generator Option only supports QR Model2, does not support Model1. The following parameters can be specified.

Parameter Value Default value Contents
typeQRMicroQRRequired
verauto 1 to 40 auto 1 to 4 autoVersion
eclauto L M Q HautoError correction level
encauto N A B KautoEncoding
autoEquivalent to NABK
NNumbers 0123456789
AAlphanumeric 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ$%*+-./: space
BBytes
KKanji Shift JIS
mprauto 0 to 7 auto 0 to 3 autoMask pattern reference
outsvg pngpngOutput formats
dpiNon-negative numbers 0The png image resolution. (0, if nothing specified)
scalePositive numbers 1Output size in module unit
charsetArbitrary character strings UTF-8Encoding by the direct character string specification

Multiple values can be specified to enc excluding auto. For instance, suppose enc=NAB is specified, these three are mixed and outputted appropriately. If failed to output with the specified encoding, an error will be generated.

Some sort of masking is given to QR so that a monochrome pattern may become even as much as possible. The mpr specification by the mask pattern reference enforces this processing to one particular pattern. It may be less uniformity than the pattern automatically selected, but it doesn't mean the wrong QR.

The dpi specification for image resolution is effective only with png and the value of a real number can be specified. The unit should not be included.

Values that can be specified to scale, the output size in module unit, differ between svg and png.

The charset specification indicates the encoding outputted to QR when the character string is specified directly and it's not base64. This setting is applied when kanji is not specified to the encoding. The data specified by base64 is outputted as is with no conversion.

CAUTION: QR cannot process all range of Shift Jis codes in kanji mode. These characters may not be readable for some QR readers.

Customer Barcode

The customer barcode indicates Japan Post Customer Barcode or Intelligent Mail® Barcode, etc. The following parameters can be specified.

ParameterValueDefault ValueContents
typeJPCBCRequiredJapan Post Customer Barcode
IMBCIntelligent Mail® Barcode
POSTNET
lPositive numbersDescribed laterLength of long bar/full bar
tPositive numbersDescribed laterLength of timing bar/tracker bar
hPositive numbersDescribed laterLength of half bar (POSTNET only)
wPositive numbersDescribed laterWidth of bar
pPositive numbersDescribed laterPitch of bar
hspNon-negative numbersDescribed laterHorizontal margin
vspNon-negative numbersDescribed laterVertical margin
outsvg pngsvgOutput format
dpiPositive numbers384png image resolution

The length and width of the bar, and the margin, etc should be the values with units. Enter a value and choose a unit option (pt, pc, in, cm or mm.) The default values are as follows;

ParametersJPCBCIMBCPOSTNET
l3.6mm0.15in0.125in
t1.2mm0.05in
h0.05in
w0.6mm0.02in0.02in
p1.2mm0.045in0.0416in
hsp2.0mm0.125in0
vsp2.0mm0.028in0

When outputting png, the length and the width of the bar are rounded to the number of pixels by the dpi specification. Therefore, the output may differ slightly from the specified length. When a low resolution is specified, the barcode may not be correctly read.

The dpi specification for image resolution is effective only with png and the value of a real number can be specified. The unit should not be included.

Japan Post Customer Barcode

Japan Post Customer Barcode can be specified by the JPCBC value and the following characters can be specified. The first seven characters indicates the ZIP code. Then the numbers that show postal address will follow afterwards. If the postal address numbers indicates greater than 13 characters, by counting 2 alphabets as 1 character, then the latter parts greater than 13 characters will be discarded. Lower case will be converted into upper case.

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-

Intelligent Mail® Barcode

Intelligent Mail® Barcode can be specified by the IMBC value and only numbers with the determined digit numbers can be specified. The allowed digit numbers are 20, 25, 29 or 31. In addition, the second digit must be 0 to 4.

POSTNET

Only numbers with the determined digit numbers can be specified to POSTNET. The allowed digit numbers are 5, 9, or 11.

Linear Barcode

Linear barcodes indicate 1 dimensional barcodes. The following parameters can be specified.

ParameterValueDefault valueContents
typeEAN JANRequired
UPCUPC-A, UPC-E
ITFInterleaved 2of5
Codabar NW-7
Code39
Code128
GS1-128 EAN-128
wPositive numbers0.33mmWidth of thin bar
rPositive numbers2.5Width ratio between thin and wide bars
It's not used with EAN JAN UPC Code128 GS1-128 EAN-128
hPositive numbers22.86mmWidth of bar
qzNon-negative numbers10Specifies the horizontal margin (quiet zone) by the number of thin bars.
scalePositive numbers1Display magnification
outsvg pngsvgOutput format
dpiPositive numbers384png image resolution
textnonenoneSpecifies how the text of an original code is displayed under the barcode.
auto
center
justify

The length and width of the bar, and the margin, etc should be the values with units. Enter a value and choose a unit option (pt, pc, in, cm or mm.)

When outputting png, the length and the width of the bar are rounded to the number of pixels by the dpi specification. Therefore, the output may differ slightly from the specified length. When a low resolution is specified, the barcode may not be correctly read.

The dpi specification for image resolution is effective only with png and the value of a real number can be specified. The unit should not be included.

You can display the text of an original code under the barcode by specifying values to text. Only the typical display format can be specified. This is effective only with SVG output. Specify the font you want to use by barcode-text-font in Option Setting File. The size of a character is automatically calculated from the size of a barcode.

EAN / JAN

EAN complies with the international standard of ISO/IEC 15420:2009. JAN is the same as EAN. In EAN/JAN, the allowed digit numbers are 13 or 8 only by the figure. The last digit is the check digit. It is acceptable to input 12 digits or 7 digits excluding the check digit. When 13 digits or 8 digits are given, the last digit will be ignored, calculated and replaced correctly when outputted.

UPC

In UPC, the allowed digit numbers are 12 or 8 only by the figure. 12 digits are UPC-A, and eight digits are UPC-E. In UPC-E, the first digit must be 0 or 1. The last digit is the check digit. It is acceptable to input 11 digits or 7 digits excluding the check digit. When 12 digits or 8 digits are given, the last digit will be ignored, calculated and replaced correctly when outputted. UPC-D is not supported.

Interleaved 2of5

Interleaved 2of5 complies with the international standard of ISO/IEC 16390:2007. Interleaved 2of5 can be specified with ITF. In ITF, only the figure in the even number digit can be specified.

Codabar / NW-7

In Codabar/NW-7, the beginning of a string must be one of ABCD. The end character must be one of ABCD or TN*E. The character in the middle can be specified from the followings in any arbitrary digit. The lower case of the beginning and end of English letters will be converted into the upper case.

0123456789-$/:.+

You can specify whether to add the check digit or not. When the check digit is added, there may be a limit on characters that can be used.

ParameterValueDefault valueContentsLimitations
cdnonenoneNone
m10w2Modulus 10 weight 2Only figures available except for the beginning and end of characters.
m10w2rModulus 10 weight 2 runesOnly figures available except for the beginning and end of characters.
m10w3Modulus 10 weight 3Only figures available except for the beginning and end of characters.
m11Modulus 11Only figures with greater than or equal to 6 digits available except for the beginning and end of characters.
wm11Weight modulus 11Only figures with less than or equal to 12 digits available except for the beginning and end of characters.
m16Modulus 16
7dr 7dsr7 check DR/DSROnly figures available except for the beginning and end of characters.
9dr 9dsr9 check DR/DSROnly figures available except for the beginning and end of characters.

Code39

Code39 complies with the international standard of ISO/IEC 16388:2007. In Code39, the following characters can be specified in any arbitrary digit. The lower case of the beginning and end of English letters will be converted into the upper case.

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-.$/+% space

You can specify whether to add the check digit or not.

ParameterValueDefault valueContents
cdnonem43None
m43Modulus 43

Code128

Code128 complies with the international standard of ISO/IEC 15417:2007. In Code128, three types of code sets, CODE-A, CODE-B, and CODE-C can be specified by parameters.

ParameterValueDefault value
codeA B CB

In Code128, any arbitrary characters of U+0000 to U+007F can be expressed. Among these, U+0000 to U+001F, U+007F, and the control code will be substituted by another codes.

Input characterCODE-ACODE-BCODE-C
U+0020SPACESPACEN/A
U+0021!!N/A
U+0022""N/A
U+0023##N/A
U+0024$$N/A
U+0025%%N/A
U+0026&&N/A
U+0027''N/A
U+0028((N/A
U+0029))N/A
U+002A**N/A
U+002B++N/A
U+002C,,N/A
U+002D--N/A
U+002E..N/A
U+002F//N/A
U+0030000
U+0031111
U+0032222
U+0033333
U+0034444
U+0035555
U+0036666
U+0037777
U+0038888
U+0039999
U+003A::N/A
U+003B;;N/A
U+003C<<N/A
U+003D==N/A
U+003E>>N/A
U+003F??N/A
    
Input characterCODE-ACODE-BCODE-C
U+0040@@N/A
U+0041AAN/A
U+0042BBN/A
U+0043CCN/A
U+0044DDN/A
U+0045EEN/A
U+0046FFN/A
U+0047GGN/A
U+0048HHN/A
U+0049IIN/A
U+004AJJN/A
U+004BKKN/A
U+004CLLN/A
U+004DMMN/A
U+004ENNN/A
U+004FOON/A
U+0050PPN/A
U+0051QQN/A
U+0052RRN/A
U+0053SSN/A
U+0054TTN/A
U+0055UUN/A
U+0056VVN/A
U+0057WWN/A
U+0058XXN/A
U+0059YYN/A
U+005AZZN/A
U+005B[[N/A
U+005C\\N/A
U+005D]]N/A
U+005E^^N/A
U+005F__N/A
    
Input characterCODE-ACODE-BCODE-C
U+0060U+0000`N/A
U+0061U+0001aN/A
U+0062U+0002bN/A
U+0063U+0003cN/A
U+0064U+0004dN/A
U+0065U+0005eN/A
U+0066U+0006fN/A
U+0067U+0007gN/A
U+0068U+0008hN/A
U+0069U+0009iN/A
U+006AU+000AjN/A
U+006BU+000BkN/A
U+006CU+000ClN/A
U+006DU+000DmN/A
U+006EU+000EnN/A
U+006FU+000FoN/A
U+0070U+0010pN/A
U+0071U+0011qN/A
U+0072U+0012rN/A
U+0073U+0013sN/A
U+0074U+0014tN/A
U+0075U+0015uN/A
U+0076U+0016vN/A
U+0077U+0017wN/A
U+0078U+0018xN/A
U+0079U+0019yN/A
U+007AU+001AzN/A
U+007BU+001B{N/A
U+007CU+001C|N/A
U+007DU+001D}N/A
U+007EU+001E~N/A
U+00BFU+001FU+007FN/A
U+00C0FNC3FNC3N/A
U+00C1FNC2FNC2N/A
U+00C2SHIFTSHIFTN/A
U+00C3CODE-CCODE-CN/A
U+00C4CODE-BFNC4CODE-B
U+00C5FNC4CODE-ACODE-A
U+00C6FNC1FNC1FNC1

The following characters are available to input.

CODE-AU+0020 to U+007E, U+00BF to U+00C6
CODE-BU+0020 to U+007E, U+00BF to U+00C6
CODE-CFigures with even number digits, U+00C4 to U+00C6

GS1-128 / EAN-128

GS1-128/EAN-128 is Code128 with some kind of restriction. Barcode Generator Option will check the following points (or may not). The restrictions other than these are the same as Code128.

  • It is necessary to start with FNC1.
  • Characters that can be used excluding the control code are as follows. (white space is not included.)

    !"%&'()*+-./0123456789:;<=>?
    ABCDEFGHIJKLMNOPQRSTUVWXYZ_
    abcdefghijklmnopqrstuvwxyz

  • FNC2 and FNC4 cannot be used.
  • Recognizes the already-known application identifier (AI) and check the number of characters. Does not check the character format.
  • Does not check FNC1 in case of the fixed length even if is a necessary format.

The following shows the already registered AI. If you want to change the format or AI is not listed here, It is available to add changes in Option Setting File. The last digit of AI, * shows any arbitrary figures. For instance, 310* indicates 3100 to 3109. Format has the following meanings. The last F of the format shows that FNC1 is required.

  • n3 : 3-digit numbers
  • x3 : 3-digit arbitrary characters
  • n-10 : Numbers with greater than or equal to 1 and less than or equal to 10 digits.
  • x3-10 : Arbitrary characters with greater than or equal to 3 and less than or equal to 10 digits.
AIformat
00n18
01n14
02n14
03n14
04n16
10x-20 F
11n6
12n6
13n6
14n6
15n6
16n6
17n6
18n6
19n6
20n2
21x-20 F
22x-29 F
23*x-19 Note
240x-30 F
241x-30 F
242x-6 F
250x-30 F
251x-30 F
252n27
253n14-30 F
254x-20 F
    
AIformat
30n-8
310*n6
311*n6
312*n6
313*n6
314*n6
315*n6
316*n6
320*n6
321*n6
322*n6
323*n6
324*n6
325*n6
326*n6
327*n6
328*n6
329*n6
330*n6
331*n6
332*n6
333*n6
334*n6
335*n6
336*n6
337*n6
    
AIformat
340*n6
341*n6
342*n6
343*n6
344*n6
345*n6
346*n6
347*n6
348*n6
349*n6
350*n6
351*n6
352*n6
353*n6
354*n6
355*n6
356*n6
357*n6
360*n6
361*n6
362*n6
363*n6
364*n6
365*n6
366*n6
367*n6
368*n6
369*n6
    
AIformat
37n-8 F
390*n-15 F
391*n4-18 F
392*n-15 F
393*n4-18 F
400x-30 F
401x-30 F
402n17 F
403x-30 F
410n13
411n13
412n13
413n13
414n13
415n13
420x-20 F
421x4-12 F
422n3 F
423n4-15 F
424n3 F
425n3 F
426n3 F
7001n13 F
7002x-30 F
7003n10 F
7004n-4 F
703*x4-30 F
    
AIformat
8001n14 F
8002x-20 F
8003x15-30 F
8004x-30 F
8005n6 F
8006n18 F
8007x-30 F
8008n9-12 F
8018n18 F
8020x-25 F
8100n6 F
8101n10 F
8102n2 F
8110x-30 F
90x-30 F
91x-30 F
92x-30 F
93x-30 F
94x-30 F
95x-30 F
96x-30 F
97x-30 F
98x-30 F
99x-30 F

Note: The format of 23* is the fixed length of digit number 2*+1 against the number * of the last digits. For instance, if it is 234, it becomes x9.