javascript - esc/pos command how to calculate the nL nH? -
i want set position of head of printer through esc / pos:
esc $ set absolute horizontal position esc $ nl nh how calculate nl, nh?
here excerpt documentation printer yours: "name: set absolute print position function: sets distance beginning of line range: 0 ≤ nl ≤ 255 0 ≤ nh ≤ 255 [details] ·the distance beginning of line print position [(nl + nh x 256) x (horizontal motion unit)] inches.
nh - number of printing symbol positions begin of line, nl - number of printing points begin of line. , seems each symbol position conststs of 256 points.
so, nl remainder disivion horizontal position 256 , used "fine tuning" of horizontal position.
so, given head position offset line begin (in inches) get:
$nl = floor(($offsetfromlinebeginininches/$horizontal_motion_unit) / 256); $nh = ($offsetfromlinebeginininches/$horizontal_motion_unit) % 256; default horizontal motion unit can in documentation specific printer
Comments
Post a Comment