JSPrintManager
Print, Scan & Talk to any Device from JavaScriptKey Features
Print ESC/P, PCL, PostScript, ZPL, EPL, PDF, XLS, DOC
Thermal, impact, dot-matrix, RFID, kiosk, POS, receipt
WebScan support for TWAIN-compatible devices
BIDI Comm: Serial, USB/HID, Bluetooth & TCP
Cross-browser & Plugin-free (Pure JavaScript)
Clients: Windows, Linux, Android, RPi & Mac!
Download JSPrintManager Buy
Advanced Client-side Printing & Scanning Solution for Javascript
JSPrintManager is a Javascript + Client App solution for Client-side Printing & Scanning scenarios designed to be used in any Website developed on top of any Web Platform including ASP.NET MVC/CORE, PHP, Django, Ruby On Rails (RoR), Express.js, Angular, React, Blazor and more!
By writing pure Javascript code, JSPrintManager allows you to easily send raw data, text and native commands as well as known file formats (like PDF, TXT, DOC, XLS, JPG, PNG, Multipage TIFF) to any printer installed or available at the client machine without showing or displaying any print dialog box! Scan Documents & Images is also supported!
Quick Start: Print, Scan & Talk to Devices from JavaScript
- Add JSPrintManager.js to your page (download or
npm install jsprintmanager). - Install the JSPrintManager Client App on the client machine (once).
- Create a print job, a scan job or a BIDI comm session and send it to the client.
Print raw ZPL to a Zebra printer (no dialog)
<script src="JSPrintManager.js"></script>
<script>
JSPM.JSPrintManager.auto_reconnect = true;
JSPM.JSPrintManager.start();
JSPM.JSPrintManager.WS.onStatusChanged = function () {
if (JSPM.JSPrintManager.websocket_status === JSPM.WSStatus.Open) {
var cpj = new JSPM.ClientPrintJob();
cpj.clientPrinter = new JSPM.InstalledPrinter("Zebra ZD420");
cpj.printerCommands = "^XA^FO50,50^A0N,40,40^FDHello from JSPrintManager^FS^XZ";
cpj.sendToClient();
}
};
</script>
Print a PDF silently to the default printer
var cpj = new JSPM.ClientPrintJob();
cpj.clientPrinter = new JSPM.DefaultPrinter();
var pdf = new JSPM.PrintFilePDF(
"/files/invoice.pdf", // file URL
JSPM.FileSourceType.URL,
"invoice.pdf",
1 // copies
);
cpj.files.push(pdf);
cpj.sendToClient();
No Adobe Reader required. See tray, paper size, duplex & page range options.
Scan a document to PDF
var scan = new JSPM.ScanJob();
scan.scannerName = "Canon DR-C225"; // any TWAIN/SANE scanner
scan.resolution = 200;
scan.pixelMode = JSPM.PixelMode.Grayscale;
scan.imageFormat = JSPM.ScannerImageFormatOutput.PDF;
scan.onUpdated = function (data) {
// the scanned file is returned to your page:
// preview it or upload it to your server
};
scan.sendToClient();
TWAIN, SANE & ImageCaptureCore scanners on Windows, Linux & macOS. Full scanning guide.
Read a weighing scale over a serial port (BIDI)
var scale = new JSPM.SerialComm("COM3", 9600,
JSPM.Serial.Parity.None, JSPM.Serial.StopBits.One,
JSPM.Serial.DataBits.Eight, JSPM.Serial.Handshake.None);
scale.onDataReceived = function (data) {
document.getElementById("weight").textContent = data;
};
scale.open().then(function () {
scale.send("W\r\n"); // ask the scale for the current weight
});
Same bidirectional model for TCP/IP, Bluetooth, USB & HID devices.
Features at a Glance
Raw Data Printing
Send any raw data & commands supported by the client printer like EPSON ESC/POS, HP PCL, PostScript, Zebra ZPL and Eltron EPL, and more! Shipping labels generated by postal services like UPS, FedEx, USPS, DHL as well as PRN files are also supported!
Advanced PDF Printing
Print PDF files without requiring Adobe Reader or any other external software! Advanced PDF Printing settings include Tray Name, Paper Size, Print Rotation, Pages Range, Auto Rotate, Auto Center, Duplex, Password-protection, and more!
Advanced DOC Printing
Print DOC files silently with Advanced Printing settings including Password-protected files, manual Duplex, Pages Range, and more!
Advanced XLS Printing
Print XLS files silently with Advanced Printing settings including Password-protected files, Pages Range, and more!
Print Files With Password
Print Password Protected PDF, DOC & XLS files! The password protected file is set at server side and the password to unlock it is encrypted and embedded into the file as part of its metadata.
Advanced TIFF Printing
Print Multipage TIFF image files silently with Advanced Printing settings including Tray Name, Paper Size, Print Rotation, Pages Range, Auto Rotate, Auto Center, Duplex, and more!
Advanced TXT Printing
Print TXT files or just plain text including settings like Font (name, size, style), Text Color, Text Alignments (left, center, right, justify) , Print Orientation, and more!
Print Group of Files!
Print a Group of Files (Mix Images, PDF & TXT) as they were part of a single multipage document with advanced settings like tray, paper source, duplex printing, pages range and more! Useful for CARD ID Printing scenarios.
Scan Docs & Images
Scan docs & images through any TWAIN/SANE-compatible devices specifying settings like DPI Resolution, Pixel Mode (Grayscale, Color, Black & White), and Output Image Format (JPG, PNG, TIF & PDF)! Duplex & Feeder (ADF), Show UI & Barcode Decoding (QR, Code39/128, PDF417, EAN/UPC, I25) are also supported!
Get Scanners Info
Get details like device name, horizontal and vertical resolutions supported, whether the device supports duplex, feeder and more about the scanner devices available in the client system.
Get Printers Info & Status
Besides getting the list of installed printers available in the client machine, you can also get further details like DPI Resolution, PortName, "Is Connected", "Is Shared", "Is Local", "Is Network", "Is Virtual or Real/Physical printer?", as well as the list of supported Papers, Media Types and list of trays/bins!
Take Video Snapshots
Use video devices as a scanner or take video snapshots specifying settings like Pixel Mode (Grayscale & Color), and Output Image Format (JPG & PNG) & PDF!
Get Video Devices
Get list of video input (camera) devices available in the client system.
Get Bluetooth Devices
Get the list of Bluetooth devices available in the client machine including details like Name, Address, Class of Device, Connected, Remembered, and Autheticated
BIDI Serial Comm
Bidirectional Serial Port Communication support! Send/Write & Receive/Read data strings to any RS-232, COM & TTY port available on the client system. Can be used with any type of devices like Weighing Scales!
BIDI TCP/IP Comm
Bidirectional TCP/IP Communication support! Send/Write & Receive/Read data to any TCP Address and port reachable from the client system. The Address requires to be in the client's allow list!
BIDI Bluetooth Comm
Bidirectional Bluetooth Communication support! Send/Write & Receive/Read data to any BT Address and channel reachable from the client system. The Address requires to be in the client's allow list!
IPP Comm
IPP (Internet Printing Protocol) Communication support! Send/Request IPP JSON messages to any IPP URI device and get IPP JSON response from the client system. The target IPP Device URI requires to be in the client's allow list!
BIDI USB / HID Comm
Bidirectional direct USB / HID Communication support! Send/Write & Receive/Read data to any USB / HID devices reachable from the client system.
Printer Connectivity
Client Printers Connectivity support: installed printers through Printer Driver (for USB connection), Shared Printers, Parallel Port (LPT), Bluetooth (RFCOMM) or Serial Port RS-232 (COM) as well as IP/Ethernet Network printers. On Linux & Mac OS, any kind of printer installed through CUPS is supported.
Trays & Bins Support
If the printer is installed in the client system through a Printer Driver, then you can specify to which Tray Name to send the print job. You can also get the list of trays & bins.
Paper Names & Sizes
If the printer is installed in the client system through a Printer Driver, then you can specify the Paper Size if desired. You can also get the list of supported papers and their physical sizes.
Media Types
If the installed printer supports Media Types, then you can get the list of supported media types and specify it when printing.
Printers Watcher
Detect when a new printer is added, when a printer is removed/deleted, and when any changes or modifications are done on any printers available at the client machine.
Get Print Jobs Status
Trace print jobs status when targeting any installed client printers. Got notified whether the print job completed, number of printed pages, and many more related information.
Print to Any Printer
Print to any brand and type of client printers! Thermal Label Barcode printers, POS receipt printers, Impact printers, Ticket printers, RFID printers, Dot-Matrix, 3D Printers and more!
Cross Platform Client
Any Client platform can print from your Website. JSPrintManager App supports Windows, macOS / OS X, Linux, Android & Raspberry Pi (Linux ARM) devices. It's a very small client App without external dependencies! No ActiveX, No Flash, No Silverlight, No Java, No .NET Framework
Device ID
Each device that connects to your website through JSPrintManager is assigned an unique Device ID based on the OS native machine UUID/GUID. You can get this ID through javascript code.
Client App Info
Get the JSPrintManager App info that connects to your website. You can get the client app Version number, the OS name and arch type through javascript code.
Print Server Mode
JSPrintManager can be installed and configured as a dedicated print service on a given Desktop, Server or Device running Windows, Linux, macOS/OSX or Raspberry Pi OSes
Print from Mobile & Sandboxed Devices
With JSPrintManager in Print Server Mode, clients such as mobile/sandboxed devices (running iOS, Android, ChromeOS...) and Terminal Services/Citrix environments will be able to print from your website! Useful for Mobile Billing, Mobile POS, Mobile Ordering, etc.
Multi-Users Scenario / RDS
JSPrintManager app supports environments where multiple user sessions are active on the same machine or under remote-desktop scenarios such as RDP or Terminal Services, Citrix, VMware, etc.
Looking for Blazor Server & WebAssembly support? Then try our JSPrintManager for Blazor edition!
JSPrintManager Components
The Website/Javascript component
JSPrintManager is a Javascript object which is used in your website to generate "Client Print Jobs". A Client Print Job allows you to specify which client printer to use (Default, one specific Printer Name, show system Printer dialog box or some LPT, Bluetooth, TCP/IP or RS232 COM port) as well as the commands or files you want to print or send to the specified client printer.
Download JSPrintManager.js CodeThe Client-side component
The JSPrintManager App needs to be installed at the client machine just once. It's a lightweight native app (without any dependencies) that processes all the "Client Print Jobs" generated by the Javascript object. JSPrintManager App can be installed on Windows, Linux, Mac, Android & Raspberry Pi! It also can be configured as a dedicated Print Service to support printing from Mobile & Sandboxed Devices
Download JSPrintManager Client AppWhite Label / Custom Branding Support!
If you are integrating JSPrintManager into your own web application or solution, you may wish to apply your own branding in order to deliver a consistent experience to your customers. White Label (Custom Branding) Licensing for the JSPrintManager Client App is available!
How does it work?
After providing us your Company & Application Info as well as the required Artworks (for your app and installers), you'll get access to the ready-to-use custom installers for all the supported clients - Windows, macOS & Linux. You'll also get the binaries and scripts in case you wanted to digitally sign and notarize your custom branded app and/or use any other installer tool or technology!Your White Label App under Windows
Your White Label App under macOS
Your White Label App under Linux
White Label App for Android is not available
Print RAW data and commands to a full range of Client Printers from your Website
What's Raw Printing?
Raw Printing (a.k.a. "Raw Data Printing", "DOS-Mode Printing", "Line-Mode Printing") is the process of sending a stream of bytes (sometimes simple ASCII characters) directly to the target printer hardware. Those bytes are expressed by following the syntax and rules of the Command Language (a.k.a. Programming Language) supported by the target printer. Some Raw Printing Languages are composed of human-readable ASCII characters (like Zebra ZPL, EPL, etc) while others combine them with non-printable characters like is the case of the famous ESC/P, Postscript and PCL languages. Our JSPrintManager allows you to send those commands to your clients' printers from your website through an elegant and simple plugin-free approach.
How to configure RAW Printing Mode in...
Windows Linux / Raspberry Pi macOS / OSXAny Client Printer Brand or Type
JSPrintManager does support any kind of printers! That means you can print and send raw commands from your Website to any brand of Thermal Label Barcode printers, POS receipt printers, Impact printers, Ticket printers, RFID printers, Dot-Matrix printers, Kiosk printers, Cash Drawers/Registers, Slip printers, Multifunction printers, ID Card printers, Wristband printers, Passbook or Bankbook printers, Kitchen printers, Laser printers and Inkjet printers installed or available at the client machine.
Printer Connectivity Support
JSPrintManager does support local installed printers with the correct driver or the "Generic / Text Only" driver built-in Windows (for USB connection), Shared Networks printers with a UNC name, printers directly connected to Parallel Port (e.g. LPT1) Centronics, Bluetooth (RFCOMM) or Serial Port RS-232 (e.g. COM1) as well as IP/Ethernet Network printers (e.g. DNS printer name + Port 9001). On Linux, Raspberry Pi & Mac OS, JSPrintManager leverages built-in CUPS system so any kind of printer installed through CUPS is supported.
Any Printer Command Language is Supported
You can use JSPrintManager in your Website for sending and printing any printer programming languages like Epson ESC/P, HP PCL, PostScript, Zebra ZPL and Eltron EPL, Zebra XML-enabled format, Intermec IPL, Datamax-O'Neil DPL, Godex EZPL, Printronix ZGL, SATO SBPL, Avery-Dennison (Monarch) RCL, Wasp WPL, Citizen CLP, IBM Proprinter, Cognitive-TPG CPL, Dymo ESC codes, Samsung-Bixolon ESC/POS codes and SPL, TOSHIBA-TEC TCPL, TSC TSPL-EZ, DASCOM, etc. In fact, any other printer languages that can be expressed as an array of bytes are supported! Of course, you can also print ZPL or EPL shipping labels generated by postal services like UPS, FedEx, USPS, DHL, etc. In addition to native printer commands, you can also print PRN files!
Client App - Operating System Support Features Matrix
- Supported
- Partial or limited
- Not supported
Query operations
Message (type) |
Windows | Linux | macOS | Android | Notes |
|---|---|---|---|---|---|
session_certificate, get_user, sites_manager, get_app_instances, fonts_list |
Supported | Supported | Supported | Not supported | |
mac_address |
Supported | Supported | Supported | Supported | |
get_device_id |
Supported | Supported | Supported | Supported | |
serial_ports_list |
Supported | Partial | Partial | Not supported | On Unix it returns every /dev/tty* entry without filtering |
bt_devices_list |
Supported | Supported | Supported | Supported | |
scanner_list, scanners_complete_list |
Supported | Supported | Supported | Not supported | TWAIN, SANE, ImageCaptureCore |
video_input_list |
Supported | Not supported | Not supported | Not supported | Returns an empty array outside Windows |
usb_devices_list, hid_devices_list |
Supported | Not supported | Not supported | Not supported | Returns an empty array outside Windows |
get_default_paper_name, get_default_tray_name, get_paper_info, get_papers, get_trays, get_media_types |
Supported | Supported | Supported | Not supported | |
printer_delete_jobs |
Supported | Supported | Supported | Not supported | Windows: spooler purge. Unix: cancel -a. |
ipp_message |
Supported | Supported | Supported | Supported | |
printers_list, refresh_printers |
Supported | Supported | Supported | Not supported | |
printers_complete_list |
Supported | Partial | Partial | Not supported | On Unix the extended level falls back to basic. Printer icons are available on Windows and macOS, not on Linux. The BIDIEnabled property reflects the real printer setting only on Windows; on Linux and macOS it is always false. |
on_printer_creation, on_printer_deletion, on_printer_modification |
Supported | Not supported | Not supported | Not supported | Unix returns "Not implemented" |
Bidirectional communication (BIDI Comm)
A BIDI Comm session keeps an open channel between the web page and a device, so the page can both send data and receive responses.
Channel (type) |
Windows | Linux | macOS | Android | Notes |
|---|---|---|---|---|---|
Serial Comm (serial) |
Supported | Supported | Supported | Not supported | Any serial port name the OS exposes (COMx, /dev/tty*) |
TCP Comm (tcp) |
Supported | Supported | Supported | Supported | Target host must be in the allow list |
Bluetooth Comm (bt) |
Supported | Supported | Supported | Supported | RFCOMM sockets on Windows and Linux, IOBluetooth on macOS |
IPP Comm (ipp_message) |
Supported | Supported | Supported | Supported | Request/response over HTTP; device URI must be in the allow list |
USB Comm (usb) |
Supported | Not supported | Not supported | Not supported | Windows only; outside Windows the request gets no response |
HID Comm (hid) |
Supported | Not supported | Not supported | Not supported | Windows only; outside Windows the request gets no response |
Scanning (scan_job)
| Capability | Windows | Linux | macOS | Android | Notes |
|---|---|---|---|---|---|
| Scan from a scanner device | Supported | Supported | Supported | Not supported | TWAIN, SANE, ImageCaptureCore |
| Output as JPG, PNG, TIFF or PDF | Supported | Supported | Supported | Not supported | |
| Barcode detection | Supported | Not supported | Not supported | Not supported | QR, Code39/128, PDF417, EAN/UPC & I25 |
Scan from a camera (UseVideoDevice) |
Supported | Not supported | Not supported | Not supported | Linux and macOS raise "Video Scan is not supported under this OS" |
Printing (binary cpj / cpjg messages)
| Capability | Windows | Linux | macOS | Android | Notes |
|---|---|---|---|---|---|
| Print job and job group, with status tracking | Supported | Supported | Supported | Not supported | |
| Advanced PDF printing | Supported | Partial | Supported | Not supported | Not available on Linux ARM |
| Advanced DOC / XLS printing | Supported | Not supported | Not supported | Not supported | Requires Microsoft Office. |
| Generic documents (docx, odt, ppt, etc.) | Supported | Partial | Partial | Not supported | Windows: ShellExecute printto. Unix: requires LibreOffice. |
| TXT, TIF, images and RAW | Supported | Supported | Supported | Partial |
Printer types (print job type)
| Printer type | Windows | Linux | macOS | Android | Notes |
|---|---|---|---|---|---|
0 Default printer |
Supported | Supported | Supported | Not supported | Prints to the OS default printer. |
1 Installed printer |
Supported | Supported | Supported | Not supported | Any printer installed in the OS, by name. See the options table below. |
2 Parallel port printer |
Supported | Not supported | Not supported | Not supported | Windows writes directly to the LPT port. On Linux and macOS, install the printer in CUPS and use it as an installed printer. |
3 Serial port printer |
Supported | Supported | Supported | Not supported | Requires port, baud rate, data bits, flow control, parity and stop bits. |
4 Network printer (IP/DNS and port) |
Supported | Supported | Supported | Supported | Direct TCP socket connection |
5 User-selected printer (print dialog) |
Supported | Supported | Supported | Not supported | Shows the OS print dialog; cancelling it fails the job |
6 Bluetooth printer |
Supported | Supported | Supported | Supported | Requires device address and RFCOMM channel |
Installed printer options
| Option | Windows | Linux | macOS | Android | Notes |
|---|---|---|---|---|---|
name, use_default |
Supported | Supported | Supported | Not supported | With use_default, falls back to the default printer if the name is not found |
paper, paper_index |
Supported | Supported | Supported | Not supported | |
Custom paper size in paper |
Supported | Supported | Supported | Not supported | Only if the printer supports custom paper |
tray, tray_index |
Supported | Supported | Supported | Not supported | |
duplex |
Supported | Supported | Supported | Not supported | |
media_type |
Supported | Supported | Supported | Not supported | Ignored if the printer rejects the value |
page_trays (tray per page) |
Supported | Not supported | Not supported | Not supported | PDF files only |
auto_tray_by_page_size |
Supported | Not supported | Not supported | Not supported | PDF files only. Ignored when page_trays is set. |
auto_detect_raw_mode_data_type, driver_model |
Supported | Not supported | Not supported | Not supported | Uses XPS_PASS for v4 drivers, RAW otherwise |
JSPrintManager FAQ
- Does the end user need to install anything?
- Yes. The JSPrintManager Client App must be installed once on the client machine. It is a lightweight native app with no external dependencies (no Java, no .NET Framework, no browser plugin) for Windows, macOS, Linux, Raspberry Pi and Android.
- Can I print from the browser without showing the print dialog?
- Yes. JSPrintManager sends print jobs directly to a client printer (default, installed by name, network IP/port, serial, parallel or Bluetooth) without displaying any print dialog. You can also show the OS dialog on purpose if you prefer.
- How is this different from
window.print()? window.print()always shows the browser print dialog, only prints the current page, and cannot choose a printer, tray or paper size, or send raw printer commands. JSPrintManager can do all of that from JavaScript.- Do I need Adobe Reader to print PDF files?
- No. PDF, TXT, PNG, JPG and BMP are printed natively. DOC and XLS printing requires Microsoft Office on Windows.
- Which printer languages are supported?
- Any language that can be sent as bytes, including Zebra ZPL, Eltron EPL, Epson ESC/POS, HP PCL, PostScript, Intermec IPL, Datamax DPL, SATO SBPL, TSC TSPL and more, plus PRN files and UPS/FedEx/USPS/DHL shipping labels.
- Can I print from iOS, ChromeOS or Citrix?
- Yes, using Print Server Mode: install JSPrintManager as a dedicated print service on a Windows, Linux, macOS or Raspberry Pi machine, and mobile, sandboxed or Terminal Services/Citrix clients can print through it.
- Which web frameworks does it work with?
- Any, because it is plain JavaScript: ASP.NET (MVC/Core), PHP, Django, Ruby on Rails, Express.js, Angular, React and others. For Blazor Server and WebAssembly there is a dedicated JSPrintManager for Blazor edition.
- Is JSPrintManager free?
- It is a commercial product with a fully functional evaluation version. See licensing and pricing.
- Can I scan documents from a web page?
- Yes. JSPrintManager scans from TWAIN, SANE and ImageCaptureCore scanners on Windows, Linux and macOS, with DPI, color mode, duplex and feeder (ADF) settings, and returns the result as JPG, PNG, TIFF or PDF to your page.
- Can I read data from a weighing scale or other serial, USB or Bluetooth device from the browser?
- Yes. JSPrintManager supports bidirectional (BIDI) communication: your page can send and receive data with serial (RS-232/COM/TTY), TCP/IP, Bluetooth and IPP devices, and with USB/HID devices on Windows. Unlike the Web Serial API, which only works in Chromium-based browsers, it works in any browser because the JSPrintManager Client App handles the device connection.