iPhone QR-Code Barcodes Generator for iPhone Objective-C

Generate, Draw, Create, Print QR-Code in Objective-C



Barcode QR Code Generators

.NET QR Code Generator
Java QR Code Generator
Index
QR Code is a matrix code (or two-dimensional bar code) created by Japanese corporation Denso-Wave in 1994. The "QR" is derived from "Quick Response", as the creator intended the code to allow its contents to be decoded at high speed.
iPhone QRCode supports:
  • numeric data (digits 0 - 9);
  • alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : );
  • byte data (default: ISO/IEC 8859-1);
  • Kanji characters.
  1. Create a barcode object
  2. Set barcode properties
  3. call drawWithView() method, to paint barcode on the canvas.

Sample Code:
- (void)drawRect:(CGRect)rect {
    // Drawing code
    
    OBLinear *pLinear = [OBLinear new];
    [pLinear setNBarcodeType: OB_CODE128A];
    [pLinear setPDataMsg: [[NSString alloc] initWithString: (@"AB")]];
    //[pLinear setPSupData: [[NSString alloc] initWithString: (@"14562")]];
    [pLinear setFX: USER_DEF_BAR_WIDTH];
    [pLinear setFY: USER_DEF_BAR_HEIGHT];
    
    [pLinear setFLeftMargin: (USER_DEF_LEFT_MARGIN)];
    [pLinear setFRightMargin: (USER_DEF_RIGHT_MARGIN)];
    [pLinear setFTopMargin: (USER_DEF_TOP_MARGIN)];
    [pLinear setFBottomMargin: (USER_DEF_BOTTOM_MARGIN)];
    
    [pLinear setNRotate: (OB_Rotate0)];
    
    UIFont *pTextFont = [UIFont fontWithName: @"Arial" size: 8.0f];
    [pLinear setPTextFont: pTextFont];
    
    [pLinear drawWithView: (self)];
    [pLinear release];
    
}

Category Class Properties Default Comments
Basic pData "" NSString. QRCode value to encode
 
QRCode
Special
bProcessTilde false BOOL. Set the bProcessTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false.
~NNN: is used to represent the ASCII character with the value of NNN. NNN is from 000 - 255.
nDataMode 0 (OB_QRCODE_DATA_MODE.OB_QRCODE_Auto) OB_QRCODE_DATA_MODE.
  • OB_QRCODE_DATA_MODE.OB_QRCODE_Auto: It allows encoding all 256 possible 8-bit byte values. This includes all ASCII characters value from 0 to 127 inclusive and provides for international character set support
  • OB_QRCODE_DATA_MODE.OB_QRCODE_AlphaNumeric: It allows encoding alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ).
  • OB_QRCODE_DATA_MODE.OB_QRCODE_Byte: It allows encoding byte data (default: ISO/IEC 8859-1).
  • OB_QRCODE_DATA_MODE.OB_QRCODE_Numeric: It allows encoding numeric data (digits 0 - 9).
  • OB_QRCODE_DATA_MODE.OB_QRCODE_Kanji: It allows encoding Kanji characters.
nECL 0 OB_QRCODE_ECL.
QRCode Error Correction Level. Default is OB_QRCODE_ECL.OB_QRCODE_L (0).
  • OB_QRCODE_ECL.OB_QRCODE_L (0)
  • OB_QRCODE_ECL.OB_QRCODE_M (1)
  • OB_QRCODE_ECL.OB_QRCODE_Q (2)
  • OB_QRCODE_ECL.OB_QRCODE_H (3)
nECI 3 int. Valid values are from 000000 to 999999.
nFnc1 - -
applicationIndicator - OB_FNC1
bStructuredAppend false BOOL. Set bStructuredAppend property to true, then Structured Append is enabled.
nSymbolCount 0 int. the number of total symbols which make the sequence.
nSymbolIndex 0 int. the position of current symbol in the secuence (Start with 0).
nParity 0 int
nVersion OB_QRCODE_VERSION.OB_QRCODE_V1 (1) OB_QRCODE_VERSION.
Valid values are :
OB_QRCODE_V1 = 1,
OB_QRCODE_V2 = 2,
OB_QRCODE_V3 = 3,
OB_QRCODE_V4 = 4,
OB_QRCODE_V5 = 5,
OB_QRCODE_V6 = 6,
OB_QRCODE_V7 = 7,
OB_QRCODE_V8 = 8,
OB_QRCODE_V9 = 9,
OB_QRCODE_V10 = 10,
OB_QRCODE_V11 = 11,
OB_QRCODE_V12 = 12,
OB_QRCODE_V13 = 13,
OB_QRCODE_V14 = 14,
OB_QRCODE_V15 = 15,
OB_QRCODE_V16 = 16,
OB_QRCODE_V17 = 17,
OB_QRCODE_V18 = 18,
OB_QRCODE_V19 = 19,
OB_QRCODE_V20 = 20,
OB_QRCODE_V21 = 21,
OB_QRCODE_V22 = 22,
OB_QRCODE_V23 = 23,
OB_QRCODE_V24 = 24,
OB_QRCODE_V25 = 25,
OB_QRCODE_V26 = 26,
OB_QRCODE_V27 = 27,
OB_QRCODE_V28 = 28,
OB_QRCODE_V29 = 29,
OB_QRCODE_V30 = 30,
OB_QRCODE_V31 = 31,
OB_QRCODE_V32 = 32,
OB_QRCODE_V33 = 33,
OB_QRCODE_V34 = 34,
OB_QRCODE_V35 = 35,
OB_QRCODE_V36 = 36,
OB_QRCODE_V37 = 37,
OB_QRCODE_V38 = 38,
OB_QRCODE_V39 = 39,
OB_QRCODE_V40 = 40
 
Size Related uom 0 Unit of meature for all size related setting in the library.
0: pixel; 1: cm; 2: inch.
fX 2 width of barcode module (narrow bar), default is 2 pixel
fBarcodeWidth 0 generted barcode image width
fBarcodeHeight 0 generted barcode image height
fLeftMargin 0 image left margin
fRightMargin 0 image right margin
fTopMargin 0 image top margin
fBottomMargin 0 image bottom margin
nResolution 72 in DPI
nRotate 0 OBRotate. Valid values:
OB_Rotate0 = 0,
OB_Rotate90 = 1,
OB_Rotate180 = 2,
OB_Rotate270 = 3



All IPhone Barcode Supported Types

1D / Linear Barcodes

Code-39   |    Extended Code 39   |    Code-128   |    UCC/EAN128 (GS1 128)
UPC-A, +2, +5   |    UPC-E, +2, +5   |    EAN-8, +2, +5   |    EAN-13, +2, +5


2D / Matrix Barcodes

Data Matrix   |    QR-Code