Barcode Fonts, Components, ActiveX and .NET Windows Forms Controls, Java Servlets, 
DLLs and Barcode Scanners. IDAutomation.com, Inc., Computers Hardware, Software & Services, Tampa, FLThis site chose the Norton Secured Seal to promote trust online with consumers. View your cart in the IDAutomation Store


Home > Font Encoders > iOS, iPhone & iPad

iOS, iPhone and iPad Barcode Integration

Source Code Example

IDAutomation’s TrueType Barcode Fonts may be used in custom applications on the iPhone and iPad. The Xcode sample project and tutorial below shows how this is achieved:

Drag the barcode font file into the resources folder in the Project Window. For this example, IDAutomationHC39M.ttf will be used. Edit the Info.plist file and add IDAutomationHC39M.ttf to the "Fonts provided by application" key:

Info Plist

Use the font name in your application to call the barcode font. For example, this line of code applies the barcode font to a text field named Barcode:
[Barcode setFont:[UIFont fontWithName:@"IDAutomationHC39M" size:14.0]];

For all self-checking barcode fonts such as Code-39 that was used in the example above, be sure to include the start and stop digit. For example, to encode the text ABCDE, the text to display or print using the Code-39 barcode font would be *ABCDE* because the “*” character is the start/stop digit for Code-39.

This sample code adds parentheses around the data from the DataToEncode text field. This will have the same functionality as the asterisk but will hide the start and stop characters in the human readable data:
[Barcode etText: [NSString stringWithFormat:@"(%@)",[DataToEncode text]]];

iPhone screen with barcode

Additional symbologies such as Code-128 require a check digit calculation, in addition to start/stop characters. IDAutomation provides several font encoders that include the code to perform this conversion that can be easily rewritten in Objective C for this purpose. Barcode Font license discounts may be considered in exchange for working converted code.

 ©Copyright 2017 IDAutomation.com, All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us

Loading
Training Videos on YouTube  Join us on Google Plus  Join us on LinkedIn  Follow us on Twitter  Like us on Facebook
Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses.