JSPrintManager for Blazor
Print, Scan & Talk to any Device from BlazorKey Features
Send Raw Bytes, Text & Files to any Client Printer
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 (write C#, no JavaScript)
Clients: Windows, Linux, Android, RPi & Mac!
Download JSPrintManager for Blazor Buy
Advanced Client-side Printing & Scanning Solution for Blazor
JSPrintManager for Blazor is the most advanced solution for Client-side Printing & Scanning scenarios designed to be used in any Blazor Server & WebAssembly projects!
By writing pure .NET C# code, JSPrintManager for Blazor 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 Blazor in C#
- Add the NuGet package:
dotnet add package Neodynamic.Blazor.JSPrintManagerand@using Neodynamic.Blazorin_Imports.razor - Install the JSPrintManager Client App on the client machine (once).
- Register the service, inject it in your component and send a print job, a scan job or open a BIDI comm session.
Program.cs
using Neodynamic.Blazor;
builder.Services.AddJSPrintManager();
// .NET 8+ Blazor Server: use Interactive Server components
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
// ...
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
Works the same in Blazor Server and Blazor WebAssembly. Try both live: Server demo · WebAssembly demo.
PrintLabel.razor — raw ZPL to a Zebra printer, no dialog
@page "/print-label"
@rendermode InteractiveServer @* .NET 8+ Blazor Server *@
@inject JSPrintManager JSPrintManager
<button @onclick="PrintLabel">Print label</button>
@code {
protected override void OnAfterRender(bool firstRender)
{
if (firstRender) JSPrintManager.Start();
}
private void PrintLabel()
{
// Open = the JSPrintManager Client App is up and running
if (JSPrintManager.Status != JSPMWSStatus.Open) return;
var cpj = new ClientPrintJob
{
ClientPrinter = new InstalledPrinter("Zebra ZD420"),
PrinterCommands = "^XA^FO50,50^A0N,40,40^FDHello from Blazor^FS^XZ"
};
JSPrintManager.SendClientPrintJob(cpj);
}
}
Scan a document to PDF
private ClientScanJob scanJob = new()
{
ScannerName = "Canon DR-C225", // from JSPrintManager.Scanners
Resolution = 200,
PixelMode = PixelMode.Grayscale,
ImageFormat = ScannerImageFormatOutput.PDF,
EnableFeeder = true // use the document feeder (ADF)
};
protected override void OnInitialized()
{
JSPrintManager.OnClientScanJobStatusChanged += () =>
{
var result = JSPrintManager.ClientScanJobStatusCache
.LastOrDefault(s => s.Id == scanJob.Id);
if (result != null && !result.IsError && !result.IsLast)
scannedFiles.Add(result.Data); // preview it or save it
InvokeAsync(StateHasChanged);
};
}
private void Scan()
{
scanJob.GenerateUniqueId(); // to track this job's status
JSPrintManager.SendClientScanJob(scanJob);
}
TWAIN, SANE & ImageCaptureCore scanners on Windows, Linux & macOS. Full scanning guide.
Read a weighing scale over a serial port (BIDI)
private SerialComm scale = new()
{
PortName = "COM3", // from JSPrintManager.SerialPorts
BaudRate = 9600,
Parity = SerialPortParity.None
};
protected override void OnInitialized()
{
JSPrintManager.OnSerialCommEvent += () =>
{
var evt = JSPrintManager.SerialCommEventCache[^1];
if (evt.Type == SerialCommEventType.Open)
{
scale.DataToSend = "W\r\n"; // ask the scale for the weight
JSPrintManager.SendDataSerialComm(scale);
}
else if (evt.Type == SerialCommEventType.DataReceived)
{
weight = evt.Data;
}
InvokeAsync(StateHasChanged);
};
}
private void ReadWeight() => JSPrintManager.OpenSerialComm(scale);
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!
Print Images & Files
Print known file formats like PDF, TXT, DOC/x, XLS/x, JPG, PNG, HTML & CSS content, and more! PDF, TXT, PNG, JPG and BMP are natively supported; others will require external software like Word, Excel, LibreOffice, etc.
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, TIFF, PDF)! Under Windows, Duplex & Feeder (ADF), Show UI 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 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 Authenticated
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. Windows only
Get Print Jobs Status
Trace print jobs status when targeting any installed client printers. Get 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 from your Blazor C# 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 from your Blazor C# 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
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.
JSPrintManager for Blazor Components
The Website/Razor component
JSPrintManager for Blazor is a Razor component which is used in your Blazor project 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, or RS232 COM port) as well as the commands or files you want to print or send to the specified client printer.
Download Neodynamic.Blazor.JSPrintManagerThe 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 Razor component. 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 Blazor App
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 for Blazor does support any kind of printers! That means you can print and send raw commands from your Blazor app 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 for Blazor 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 9100). 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 for Blazor in your app 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!
Printer languages & step-by-step Blazor guides
| Printer language | Printer brands | Typical use | Blazor (C#) guide |
|---|---|---|---|
| Zebra ZPL / ZPL II | Zebra, plus printers with ZPL emulation (Honeywell, SATO, Godex, TSC...) | Shipping, barcode & RFID labels | Print raw ZPL from Blazor Print Unicode / UTF-8 text with ZPL |
| Eltron EPL / EPL2 | Zebra (Eltron legacy models) | Barcode labels | Print raw EPL from Blazor |
| Epson ESC/POS | Epson and most POS receipt printers (Star, Bixolon, Citizen...) | Receipts, kitchen tickets, cash drawers | Print raw ESC/POS from Blazor |
| TSC TSPL / TSPL2 | TSC | Barcode & product labels | Print raw TSPL/TSPL2 from Blazor |
| Intermec IPL | Intermec (Honeywell) | Industrial & shipping labels | Print raw IPL from Blazor |
| Datamax DPL | Datamax-O'Neil (Honeywell) | Industrial & shipping labels | Print raw DPL from Blazor |
| Godex EZPL | Godex | Barcode labels | Print raw EZPL from Blazor |
| BOCA FGL | BOCA Systems | Event tickets, boarding passes, wristbands | Print raw FGL from Blazor |
| PRN files | Any printer (file generated by its driver) | Pre-rendered print jobs | Print PRN files from Blazor |
| Carrier labels (UPS, FedEx, USPS, DHL) | Thermal label printers | ZPL/EPL labels returned by shipping APIs | Print raw commands from REST APIs & remote files |
| HP PCL, PostScript, SATO SBPL, others | Laser, inkjet & label printers | Any language expressed as bytes | Send as raw bytes (same code as ZPL) |
Print Common File Formats like Word docs, Excel sheets, PDF and other image formats!
In addition to print native commands, you can also use JSPrintManager for Blazor solution to send and print common file formats like PDF, TXT, DOC, XLS, JPG, PNG, and so on.
Printing File Formats Requirements
| Windows Clients | Linux, RPi & Mac Clients | |
| DOC, DOCX | Microsoft Word is required | LibreOffice is required |
| XLS, XLSX | Microsoft Excel is required | LibreOffice is required |
| Natively supported! | Natively supported! | |
| TIFF | Natively supported! | Natively supported! |
| TXT | Natively supported! | Natively supported! |
| JPEG | Natively supported! | Natively supported! |
| PNG | Natively supported! | Natively supported! |
| BMP | Natively supported! | Natively supported! |
| Printer Support | You can print files to local installed printers only! | You can print files to any installed printers in the CUPS system. |
Deployment & Troubleshooting
Your Blazor app (Server or WebAssembly) talks to the JSPrintManager Client App installed on each user's machine (or on a print server). These guides cover the environments where that connection needs extra setup; they apply to both the JavaScript and the Blazor editions.
Chrome Local Network Access
Since Chrome 142, users must click Allow once so your site can reach the local app. Companies can pre-approve domains with the LocalNetworkAccessAllowedForUrls policy. Local Network Access guide
Corporate Proxy
Set the proxy host, port and Basic, Digest or NTLM authentication on the client app. Proxy configuration
Citrix
Exclude the client app from Citrix API hooking with two registry values or a ready-made PowerShell script. Citrix configuration
Windows Kiosk Mode
Run the client app at logon for a dedicated kiosk user and allow your site once, so printing works without any prompt. Kiosk Mode configuration
iOS, ChromeOS & Android
Install the client app as a print server on a Windows, Linux, macOS or Raspberry Pi machine and let mobile and sandboxed devices print through it. Print Server Mode guide
Printer setup for raw commands
Use the manufacturer driver or Generic / Text Only on Windows, and the Raw make in CUPS on Linux and macOS. RAW printing mode setup
JSPrintManager for Blazor FAQ
- Does JSPrintManager for Blazor work with Blazor Server and Blazor WebAssembly?
- Yes. JSPrintManager for Blazor is a Razor component designed for both Blazor Server and Blazor WebAssembly projects, and you write the printing logic in C#.
- How can a Blazor app print to a client printer without the print dialog?
- Install the JSPrintManager Client App once on the client machine, then use the component to send a Client Print Job to the default printer, an installed printer by name, a network IP/port, serial, parallel or Bluetooth printer. No print dialog is shown.
- Can I print ZPL, EPL or ESC/POS from Blazor?
- Yes. Any printer command language that can be sent as bytes is supported, including Zebra ZPL, Eltron EPL, Epson ESC/POS, HP PCL and PostScript, plus PRN files and UPS/FedEx/USPS/DHL shipping labels.
- Can I print PDF files from Blazor without Adobe Reader?
- Yes. PDF, TIFF, TXT, JPEG, PNG and BMP are printed natively. DOC and XLS require Microsoft Office on Windows or LibreOffice on Linux, Raspberry Pi and macOS.
- Can users print from iOS, ChromeOS or Citrix in a Blazor app?
- Yes, using Print Server Mode: JSPrintManager runs as a dedicated print service on a Windows, Linux, macOS or Raspberry Pi machine, and mobile, sandboxed or Citrix clients print through it.
- What is the difference between JSPrintManager and JSPrintManager for Blazor?
- Both use the same JSPrintManager Client App. The standard edition is a JavaScript object for any web platform; the Blazor edition is a Razor component so Blazor developers write C# instead of JavaScript.
- Can I scan documents from a Blazor app?
- Yes. JSPrintManager for Blazor 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 C# code.
- Can a Blazor app read a weighing scale or other serial, USB or Bluetooth device?
- Yes. JSPrintManager for Blazor supports bidirectional (BIDI) communication: you can send and receive data with serial (RS-232/COM/TTY), TCP/IP, Bluetooth and IPP devices, and with USB/HID devices on Windows, all from C#. 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.
- Does printing run on the server in Blazor Server?
- No. In both Blazor Server and Blazor WebAssembly, the JSPrintManager component talks from the user's browser to the JSPrintManager Client App installed on that user's machine, so jobs go to the end user's printers, scanners and devices, not to the web server.
- What do I need for .NET 8+ Blazor Server apps?
- Use Interactive Server components: call
AddInteractiveServerComponents()andAddInteractiveServerRenderMode()in Program.cs, and add@rendermode InteractiveServerto the pages that use JSPrintManager. See the ZPL printing guide for the full setup. - Why does Chrome ask to allow Local Network Access (apps and devices) when my Blazor app uses JSPrintManager?
- Since Chrome 142, browsers require user permission before a website can connect to local apps or devices, including the JSPrintManager Client App. Users click Allow once; companies can pre-approve their domains with the
LocalNetworkAccessAllowedForUrlspolicy. See the Local Network Access guide. - Can I print HTML content from Blazor without the print dialog?
- Yes. Render the HTML element to an image with html2canvas through JS interop and send it as a PNG file in a JSPrintManager print job to any client printer, without a print dialog. See the Print HTML from Blazor guide.
- Can I print Unicode text such as Arabic, Cyrillic or Chinese to a Zebra printer from Blazor?
- Yes. Use the ZPL
^CI28(UTF-8) command with a Unicode font loaded in the printer, such as Zebra's Swiss 721, on firmware version x.14 or later. See the Unicode ZPL guide. - Do I need to configure the printer in RAW mode?
- To send raw commands such as ZPL or ESC/POS, the printer must accept raw data: on Windows use the manufacturer driver or the Generic / Text Only driver, and on Linux, Raspberry Pi and macOS add the printer in CUPS with the Raw make. PDF and image printing use the normal driver. See RAW mode on Windows and Linux / Raspberry Pi.
- Does JSPrintManager for Blazor work behind a proxy, in Citrix or in Windows Kiosk Mode?
- Yes. These are settings of the JSPrintManager Client App, so they are the same for the JavaScript and Blazor editions: proxy settings are set from the command line, Citrix needs the app excluded from Citrix API hooking, and Kiosk Mode starts the app at logon. See the Proxy, Citrix and Kiosk Mode guides.
See the full Client App operating system support matrix for per-OS details.