Encodes a string using DataMatrix format.
void DMEncode( LPCTSTR Message, WORD Mode, WORD PreferredFormat, BOOL HandleTilde); |
Parameters
Message
String to be encoded using DataMatrix format.
Mode
Indicates which encoding mode is used, this parameter can be one of the following values.
Value |
Comment |
0 |
Auto mode for optimized encoding |
1 |
ASCII encoding mode |
2 |
C40 encoding mode |
3 |
Text encoding mode |
4 |
Base256 encoding mode |
PreferredFormat
Indicates which format is used, the values of all formats are listed here.
HandleTilde
Indicates whether to process the tilde character "~" or not. If it is set to TRUE, non-printable characters can be passed to the encoder library by using the tilde character,"~dNNN" represents the ASCII character encoded by the 3 digits NNN, for example, "~d010" represents the character LF (line feed).
"~1" is used to indicate FNC1. For example, "~10107612345678900~117100503" can be used to generate GS1 DataMatrix "(01)0107612345678900(17)100503", and "~110AC34563G3" can be used to generate GS1 DataMatrix "(10)AC34563G3".
"~5" is used to indicate Macro 5. For example, "~5ABCDEF[GS]123456" can be used to generate DataMatrix "[)>[RS]05[GS]ABCDEF[GS]123456[RS][EOT]".
"~6" is used to indicate Macro 6. For example, "~6ABCDEF[GS]123456" can be used to generate DataMatrix "[)>[RS]06[GS]ABCDEF[GS]123456[RS][EOT]".
[RS] is the record separator with ASCII value 30, [GS] is the group separator with ASCII value 29, and [EOT] is the end of transmission with ASCII value 4.