A_Prn_Barcode method

int A_Prn_Barcode(
  1. int x,
  2. int y,
  3. int ori,
  4. String type,
  5. int narrow,
  6. int width,
  7. int height,
  8. String mode,
  9. int numeric,
  10. String data,
)

A_Prn_Barcode()

PURPOSE Create a "barcode" object. SYNTAX int A_Prn_Barcode(int x, int y, int ori, String type, int narrow, int width, int height, String mode, int numeric, String data); PARAMETER x; X coordinate. y; Y coordinate. ori; Orientation or print direction, 1:0�X�B2:90�X�B3:180�X�B4:270�X type; Bar code type as follows: +==========================================================================+ |Bar code |Length |Check|Type for|Type for |Valid |Bar ratio| | | |sum |readable|nonreadable|codes | | | | | |string |string | | | +============+==========+=====+========+===========+=============+=========+ |Code 3 of 9 |variable |no |'A' |'a' |09,AZ,$%+-|2:1~ | | | | | | |./and space |3:1 | +------------+----------+-----+--------+-----------+-------------+---------+ |UPC-A |12 digis |yes |'B' |'b' |09 |2:3:4 | | |(11+1) | | | | | | +------------+----------+-----+--------+-----------+-------------+---------+ |UPC-E |7 digits |yes |'C' |'c' |09 |2:3:4 | | |(6+1) | | | | | | +------------+----------+-----+--------+-----------+-------------+---------+ |Interleaved |variable |no |'D' |'d' |09 |2:1 | |2 of 5 (I25)| | | | | |3:1 | +------------+----------+-----+--------+-----------+-------------+---------+ |Code 128 |variable |yes |'E' |'e' |form code 0 |2:3:4 | | | | | | |to 127(Note1)| | +------------+----------+-----+--------+-----------+-------------+---------+ |EAN-13 |13 digits |yes |'F' |'f' |09 |2:3:4 | | |(12+1) | | | | | | +------------+----------+-----+--------+-----------+-------------+---------+ |ENA-8 |8 digits |yes |'G' |'g' |09 |2:3:4 | | |(7+1) | | | | | | +------------+----------+-----+--------+-----------+-------------+---------+ |HBIC |variable |yes |'H' |'h' |09,AZ,$%+-|2:1~ | | | | | | |./and space |3:1 | +------------+----------+-----+--------+-----------+-------------+---------+ |Coda bar |at least 3|no |'I' |'i' |09,AZ,$+-. |2:1~ | | |characters| | | |And / |3:1 | +------------+----------+-----+--------+-----------+-------------+---------+ |Interleaved |variable |yes |'J' |'j' |09 |2:1 | |2 of 5 with +----------+ | | | |3:1 | |a modulo 10 checksum | | | | | | +-----------------------+-----+--------+-----------+-------------+---------+ |Plessey |114 |yes |'K' |'k' |09 |2:1~ | | |digits | | | | |3:1 | +------------+----------+-----+--------+-----------+-------------+---------+ |Interleaved |variable |yes |'L' |'l' |09 |2:1 | |2 of 5 with +----------+-----+--------+-----------+ |3:1 | |a modulo 10 checksum and shipping bearer bars | | | +------------+----------+-----+--------+-----------+-------------+---------+ |UPC2 |2 digits |no |'M' |'m' |09 |2:3:4 | +------------+----------+-----+--------+-----------+-------------+---------+ |UPC5 |5 digits |no |'N' |'n' |09 |2:3:4 | +------------+----------+-----+--------+-----------+-------------+---------+ |Code 93 |variable |no |'O' |'o' |09,AZ,$%*+-|2:3:4 | | | | | | |./and space | | +------------+----------+-----+--------+-----------+-------------+---------+ |Postnet |variable |yes |not |'p' |09 | | | | | |defined | | | | +------------+----------+-----+--------+-----------+-------------+---------+ |UCC/EAN Code|20 digits |yes |'Q' |'q' |09 |2:3:4 | |128 |(19+1) | | | | | | +------------+----------+-----+--------+-----------+-------------+---------+ |UCC/EAN Code|18 digits |yes |'R' |'r' |09 |2:3:4 | |128 k-MART | | | | | | | +------------+----------+-----+--------+-----------+-------------+---------+ |UCC/EAN Code|variable |yes |'S' |'s' |09 |2:3:4 | |128 Random | | | | | | | |weight | | | | | | | +------------+----------+-----+--------+-----------+-------------+---------+ |Telepen |variable |yes |'T' |'t' |form code 0 |2:3:4 | | | | | | |to 127 | | +------------+----------+-----+--------+-----------+-------------+---------+ |FIM |1 |no |not |'v' |A,B,C and D | | | |character | |defined | | | | +------------+----------+-----+--------+-----------+-------------+---------+ Note1: The Code 128 supports subsets A, B, and C. The default code subset is B; otherwise, the first character (A, B, C) of the data field determines the subset. So in order to prevent misjudgment, please additional a character (A, B, C) before your data. Example: subset = B barcode data = "Bar code" output = "BBar code" Note: Please refer to the Argox PPLA Programmer Manual Section "A10. PROGRAMMING EXAMPLES FOR BAR CODES" narrow; Define the narrow bar width from 0 ~ 24. width; Define the wide bar width from 0 ~ 24. Note: The values of narrow and width must consult the proportion of bar ratio on forms. height; Bar code height. Value:0 ~ 999. mode; Add function as follows: +----+-------------------------------------+ |mode| REMARK | +----+-------------------------------------+ | A |Make auto increment for numeric. | +----+-------------------------------------+ | B |Make auto increment for alphanumeric.| +----+-------------------------------------+ | C |Make auto decrement for numeric. | +----+-------------------------------------+ | D |Make auto decrement for alphanumeric.| +----+-------------------------------------+ | N |Disable. | +----+-------------------------------------+ numeric; Automaticall increment or decrement the filed value. Value:0 ~ 99. This field must exist When has add function. data; Data string. RETURN 0 -> OK. Reference AW-Error.txt file. EXAMPLE A_Prn_Barcode(150, 20, 4, 'A', 0, 0, 20, 'B', 1, "ABCD"); REMARK The A_Prn_Barcode function can print a special Barcode�C

Implementation

int A_Prn_Barcode(
  int x,
  int y,
  int ori,
  String type,
  int narrow,
  int width,
  int height,
  String mode,
  int numeric,
  String data,
) {
  List<String> types = [
    'A',
    'a',
    'B',
    'b',
    'C',
    'c',
    'D',
    'd',
    'E',
    'e',
    'F',
    'f',
    'G',
    'g',
    'H',
    'h',
    'I',
    'i',
    'J',
    'j',
    'K',
    'k',
    'L',
    'l',
    'M',
    'm',
    'N',
    'n',
    'O',
    'o',
    'p',
    'Q',
    'q',
    'R',
    'r',
    'S',
    's',
    'T',
    't',
    'v'
  ];
  assert(types.contains(type), 'Invalid type!');
  assert(narrow >= 0 && narrow <= 24, 'narrow must be between 0 and 24.');
  assert(width >= 0 && width <= 24, 'width must be between 0 and 24.');
  assert(height >= 0 && height <= 999, 'height must be between 0 and 999.');
  assert(['A', 'B', 'C', 'D', 'N'].contains(mode), 'Invalid mode!');
  assert(numeric >= 0 && numeric <= 99, 'numeric must be between 0 and 99.');
  return _A_Prn_Barcode(
    x,
    y,
    ori,
    type.codeUnitAt(0),
    narrow,
    width,
    height,
    mode.codeUnitAt(0),
    numeric,
    data.toNativeUtf8().cast<ffi.Int8>(),
  );
}