eomer posted this 01 April 2014
i use a lot printDocument to print variable form on variable printers (pdf, laser, matrix, thermal, ) and he work perfectly.
but i tried to use printString to create script in javascript and send directly to the printer.
but, a problem occured when i tried to send positionning orders in ESC/P to an epson FX-890..
this printer request print order with value caracters encoded.
javascript exemple gotox(x) and print val_x function
function testprinterx(x)
{
var p = factory.rawPrinting;
p.printer = testmatrixprinter;
texte="";
nh=parseInt(x/256);
nl=x%256;
exte+=String.fromCharCode(0x1B);
texte+=String.fromCharCode(0x24);
texte+=String.fromCharCode(dl);
texte+=String.fromCharCode(dh);
texte=texte+"val_"+x;
p.printString(texte);
}
the problem with this function isn't in this function, she work perfectly.
the problem is in printString function.
each caracters sended to printString with value > 127 and value < 160 is converted to 80 : following , the exact list:
128,130 to 140, 142, 145 to 156, 158,159
each value in this list, sended with printString is changed to 80!
it's unusable!!
i controled ALL: javascript encoded data, printers dump, and the only position of probleme is in the printString function who CHANGE VALUES SENDED!
WHY THIS FUNCTION CHANGE MY DATAS?