47
Chapter 4 API Reference
4
addTextLang
Adds the language setting to a command buffer. Encodes the string specified by addText (p.46) according
to the language information specified by this API.
Syntax
public void addTextLang(int lang) throws EposException
Parameter
lang : Specifies the target language.
Exceptions
When processing fails, EposException is thrown with one of the following error values.
Example
This API is an API to be called before calling addText (p.46).
Set value Language
Builder.LANG_EN(default) English(ANK)
Builder.LANG_JA Japanese
Error status Description
ERR_PARAM Invalid parameter was passed.
ERR_MEMORY Could not allocate memory.
ERR_FAILURE An unspecified error occurred.
To set the language as English:
try {
Builder builder = new Builder("TM-T88V", Builder.MODEL_ANK);
builder.addTextLang(Builder.LANG_EN);
///Process///
} catch (EposException e) {
int errStatus = e.getErrorStatus();
}