@SimpleFunction(description = "This function prepares the ESC_POS commands to send to printer. in feedPaper, it will feed 2 lines after text. in printCount, it will print X copies one after another.")
public YailList prepareTextToPrint(String text, int printCount, boolean feedPaper, boolean bold, boolean underline) {
char ch = 'a';
int[] resultInt = new int[text.length()];
for(int i=0; i<text.length(); i++) //רוץ מספר פעמים של אורך המחרוזת הנדרשת המרה
{
ch = text.charAt(i);
resultInt[i] = (int)ch;
//System.out.println(resultInt[i]); //הדפסה של תאי המערך
}
List<Integer> list = new ArrayList<>(Arrays.asList(resultInt));
return resultInt.asList;
}
i need yail list of rresultInt array. how?
all what i did not helping and im stuck… help?
Use YailList.makeList(Object[] objects), yourYailList.toArray() that’ll return Object[]. If you are expecting a particular data type like Integer or Strings, you can cast them while looping on the Object[] returned by yourYailList.toArray() method.
it works.
another issue: the thermal printer prints the word in decimal byte, but all over the line like hihihihihihi
how to make it correct print? only one hi per line and spacing between words…
@SimpleFunction(description = "This function prepares the ESC_POS commands to send to printer.")
public YailList PrepareTextToPrint(String text) {
char ch = 'a';
Integer[] resultInt = new Integer[text.length()];
for(int i=0; i<text.length(); i++) //רוץ מספר פעמים של אורך המחרוזת הנדרשת המרה
{
ch = text.charAt(i);
resultInt[i] = (int)ch;
}
YailList.makeList(resultInt);
return YailList.makeList(resultInt);
}
when i do the function, it prints like: “hihihihihihihi” instead of one “hi” in the line.
i want to correct it and print only one.
how and why this is happen?
not working
i know new line is 10 decimal, but cant put it
i did /n it prints
also html code: br<> (it cant write normmaly here)
doesnt work
some other?