Properties
An applet can easily display barcodes in HTML pages. However, applets do not always work on all web browsers.
Example of how to use the applet in HTML:
<APPLET CODEBASE = "./"
ARCHIVE = "linear.jar"
CODE = "com.businessrefinery.barcode.linear.demo.DemoApplet.class"
NAME = "TestApplet"
WIDTH = 500 HEIGHT = 200 HSPACE = 0 VSPACE
= 0 ALIGN = middle >
<PARAM NAME = "DATA" VALUE = "123456789">
<PARAM NAME = "BARCODE_TYPE" VALUE = "CODE39">
<PARAM NAME = "TEXT_FONT" VALUE = "ARIAL|BOLD|14">
<PARAM NAME = "BAR_HEIGHT" VALUE = "2"> </APPLET>
The size must be specified when using the applet. Parameters can be provided in the Applet PARAM tag or from Javascript. For example, the following code will set a new value for the barcode:
TestApplet.setParameter(BARCODE,"new value");
TestApplet.refresh();
An example of using the applet is provided in the ZIP file download. The file is named "AppletTest.html".
Applet Pre-Loading
The time it takes to create barcodes on web pages using applets can be reduced by pre-loading the applet on a previous page. This type of implementation places the JAR file in the browser's cache and allows quick barcode generation - even over slow dial-up lines. The following JavaScript code pre-loads the Linear Barcode Package.
<APPLET
CODE = "com.businessrefinery.barcode.linear.demo.DemoApplet"
ARCHIVE = "linear.jar"
NAME = "PreloadApplet"
WIDTH = 1 HEIGHT = 1 HSPACE = 0 VSPACE = 0 ALIGN = top >
</APPLET>