Avery Dennison Platinum 6039 JavaScript User Manual

Page 25

Advertising
background image

Printing Functions 3-7

BatteryLevel

Description

Retrieves the LiIon battery’s level. This battery is located in the printer’s
handle. This returns a value between 1 and 100, the percentage of
charge left in the battery. Check the battery level before any processing.

Use this function immediately prior to printing, but not

during printing. If you use this function during

printing, the return value is not accurate.

Syntax

BatteryLevel

Parameters

None

Return Values

0

You must charge the battery.

1 –100

The battery level is high enough to run the printer and
print.

Example

<SCRIPT src="./jsUltra.js"></SCRIPT>

<SCRIPT type="text/javascript">

Stat;

Stat = PRINTER.BatteryLevel;

alert("Battery at " + Stat);

</SCRIPT>

<BODY>

<OBJECT id=”PRINTER” style="LEFT: 0px; WIDTH: 0px; TOP: 0px;
HEIGHT:

0px"

classid=clsid:

19C1754D-BA97-43A1-A06D-496D2167400B>

</OBJECT>

//Instantiate

Class

</BODY>

Advertising