Terminal BrowserInstallation and Programming
The Open Parcel Group Terminal Browser was developed to provide OPG members a way to develop highly functional terminal scanning programs, without the limitations associated with regular web browsers like Google Chrome, Safari and Edge.
Regular web browsers are limited for use in high volume terminal scanning. The OPG extends browser capabilities, with terminal scanning specific features.
- Rapid printing of PDF and ZPL labels, without a pop-up "Print" dialog appearing on every label.
- Direct ZPL printing without plug-ins
- Connectivity to USB scales, required for high-volume terminal processing.
- Configuration of local printers, settings and sound file play-back
Download
Visit the download page to get the lastest version of the terminal browser.
DownloadBrowser + Scale + Label Printing
The OPG Terminal browser allows developers to use familiar HTML / Web development using any web framework (Native, BootStrap, React, Angular), so development and deployment are easy.
By including the file, opgterminal.js, you can connect to new functionalities for label printing and real-time scale integration.
opg-terminal.js
This file contains everything you'll need for printing and reading from the scale. Include a copy of this file directly in your web page, you'll modify it to connect the scale to your own form field names.
Download opg-terminal.jsLabel Printing
opg-terminal.js contains functions for label printing. To print a label, your scanning operation will download the label as a base64 string. Send the label content to either the printZPL(strContent) or printPDF(strContent) as required.
Unlike regular browser printing, these label printing functions do not show a pop-up before printing every shipping label.
Labels are printed to the Windows default printer, use the Windows printer configuration to set your label printer as the default printer.
You can provide users a list of printers, and configure printers for PDF and label printing.
Scale Integration
USB scales are the easiest to connect to the OPG Terminal Browser. The program supports the following scales:
- Metler Toledo
- Dymo M10
The OPG Terminal Browser posts messages to opg-terminal.js with real-time scale weight and status. Locate the following code, update the code to post to your fields, replacing #kgdisplay, and #scalestatus with your own field names.
// Catch event messages from the OPG Terminal Browser here if( window.chrome.webview ) { window.chrome.webview.addEventListener( 'message', event => { switch( event.data.svc ) { case "scale": document.querySelector("#kgdisplay").innerHTML = event.data.data; document.querySelector("#scalestatus").innerHTML = event.data.content; break; }); }
Browser Footer Fields
You can quickly display program information directly in the browser footer page. This is useful for displaying the current user, program version, and page performance data.
The following code is run with your page loads. The postBrowser() calls send data to the page footer.
document.addEventListener("DOMContentLoaded", function (event) { // Update the user name and version in the browser status bar. postBrowser( "user", "Sample User - Adminstrator" ); // display's on the far left postBrowser( "version", "27 B/6" ); // displays on the right of the user name postBrowser( "performance", "28ms" ); // displays on the far right, after the scale information. });
If a scale is configured, the electonic scale model, status, and weight also display in the footer.
Settings
Application settings can be stored in the browser.
For settings that are not frequently updated, use the browser "localStorage" API, or similar.