
![]() ![]() ![]() | Tip: Bookmark this page with Ctrl-D (Win) or Apple-D (Mac) | Main • Products • Know How / FAQ • Download • Store • Contact |
Manual - Macintosh Dynamic Library Code EAN / ISBN - Reference
PropertiesFor each property, a set / get accessor method pair is available, see the supplied WSDY2.h file for a list.
Naming conventions: All accessor method names start with WSDY2, followed by set or get, then followed by the property name in camel casing. E.g. the property dataToEncode has the accessor methods WSDY2setDataToEncode() and WSDY2getDataToEncode().
Name | Type | Comment |
dataToEncode | char * |
Data to encode in the barcode, for EAN 8 / 13 all numeric with digits 0-9, for ISBN 10 / 13 numeric including all hyphens.
The control uses this string to auto-discriminate the required barcode type: 7 or 8 digits: Code EAN 8, ex. "1234567" 10 digits w/ hyphens: Code ISBN 10, ex. "1-123-12345-X" 13 digits w/ hyphens: Code ISBN 13, ex. "978-1-123-12345-8" 13 digits, starting with "978" or "979": Code ISBN 13, ex. "9781123123458" 12 or 13 digits: Code EAN 13, ex. "401234567890" Default: "401234567890" |
addon | char * |
Data to encode in the addon (or satellite) barcode of an ISBN. Must be 5 digits, e.g. "12345". Ignored for barcode types other than ISBN.
Default: "" |
priceText | char * |
Text (usually pricing) to put above the addon (or satellite) barcode of an ISBN. Max. 10 characters, e.g. "$ 29.95 US".
Ignored for barcode types other than ISBN. Will also be ignored if no addon was set (property addon empty string).
Default: "" |
moduleWidth | float |
Width of the smallest bar (= module) in mm.
Should be in the allowed range for Code EAN: 0.33 equals 100%, actual value can range from 82% to 200%. This property is ignored if safeMode is set to true. Default: 0.33 mm |
moduleHeight | float |
Height of the barcode in mm.
Should be between 8 and 52 mm. This property is ignored if safeMode is set to true Default: 26 mm |
safeMode | Boolean |
False: uses moduleWidth and -Height to determine size of barcode
True: ignores moduleWidth and -Height, creates a standard compliant, SC 2 (= 100%) sized barcode. Recommended for most applications. Default: true |
marginX | float |
Left and right margin of the barcode. Should not be under 5 mm.
Default: 5 mm. |
marginY | float |
Top and bottom margin of the barcode. Should not be under 5 mm.
Default: 5 mm. |
Methods
Name | Parameter | Comment |
WSDY2createCode | float dpi |
Creates a barcode, returns a CGImageRef with the code. The dpi parameter determines the output resolution, e.g. 300 for 300 dpi.
The actual dimensions of the barcode (and, hence, the returned bitmap) are determined from the moduleHeight, moduleWidth and the encoded data.
The samples provide helper functions to save the CGImageRef to a file or to convert it to an NSImage.
Returns: CGImageRef |
WSDY2bitpattern_ean13 | char *data |
Creates the actual bitpattern of a EAN 13 barcode in form of an array. Bars are set to '1' in the array, spaces are set to '0'.
Data must be 13 numeric characters, else an empty array will be returned. See the description of the samples for an example.
Returns: char * - Note: Returns NULL when in demo mode. |
WSDY2bitpattern_ean8 | char *data |
Creates the actual bitpattern of a EAN 8 barcode in form of an array. Bars are set to '1' in the array, spaces are set to '0'.
Data must be 8 numeric characters, else an empty array will be returned.
Returns: char * - Note: Returns NULL when in demo mode. |
WSDY2bitpattern_addon | char *data |
Creates the actual bitpattern of a 5-digit addon barcode in form of an array. Bars are set to '1' in the array, spaces are set to '0'.
Data must be 5 numeric characters, else an empty array will be returned.
Returns: char * - Note: Returns NULL when in demo mode. |
WSDY2checksum_ean13 | char *data |
Returns the check digit for an EAN 13 code. Data must be 12 numeric characters. To create a bitpattern, append the check digit as a
character to your data, then call the respective bitpattern function.
Returns: int |
WSDY2checksum_ean8 | char *data |
Returns the check digit for an EAN 8 code. Data must be 7 numeric characters. To create a bitpattern, append the check digit as a
character to your data, then call the respective bitpattern function.
Returns: int |
WSDY2resetToDefaults | void |
Resets all properties to the defaults as described in this document.
Returns: void |
WSDY2unlock | char *user char *key |
Unlock the library and remove the restrictions of the demo. See the supplied sample projects for an example.
Returns: Boolean - True: Successfully unlocked; False: Error. |