JSPrintManager for Blazor

Print, Scan & Talk to any Device from Blazor

Key Features

  Blazor Server & WebAssembly
  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

Quick Start: Print, Scan & Talk to Devices from Blazor in C#

  1. Add the NuGet package: dotnet add package Neodynamic.Blazor.JSPrintManager and @using Neodynamic.Blazor in _Imports.razor
  2. Install the JSPrintManager Client App on the client machine (once).
  3. 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

Client Support:  Supported on Windows, macOS, Linux, Android.   

 Advanced PDF Printing

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   
Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

 Advanced DOC Printing

Client Support:  Supported on Windows. Not supported on macOS, Linux, Android. Requires MS Word 97+.   

 Advanced XLS Printing

Client Support:  Supported on Windows. Not supported on macOS, Linux, Android. Requires MS Excel 97+.   
Client Support:  Supported on Windows. Not supported on macOS, Linux, Android.   

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

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

 Advanced TXT Printing

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   
Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

 Scan Docs & Images

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

 Get Scanners Info

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

 Get Printers Info & Status

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

 Take Video Snapshots

Client Support:  Supported on Windows. Not supported on macOS, Linux, Android.   

 Get Video Devices

Client Support:  Supported on Windows. Not supported on macOS, Linux, Android.   

 Get Bluetooth Devices

Client Support:  Supported on Windows, macOS, Linux, Android.   

 BIDI Serial Comm

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

 BIDI TCP/IP Comm

Client Support:  Supported on Windows, macOS, Linux, Android.   

 BIDI Bluetooth Comm

Client Support:  Supported on Windows, macOS, Linux, Android.   

 IPP Comm

Client Support:  Supported on Windows, macOS, Linux, Android.   

 BIDI USB / HID Comm

Client Support:  Supported on Windows. Not supported on macOS, Linux, Android.   

 Printer Connectivity

Client Support:  Supported on Windows, macOS, Linux, Android.   

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

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

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

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

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

Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   

If the installed printer supports Media Types, then you can get the list of supported media types and specify it when printing.

 Printers Watcher

Client Support:  Supported on Windows. Not supported on macOS, Linux, Android.   
Client Support:  Supported on Windows, macOS, Linux. Not supported on Android.   
Client Support:  Supported on Windows, macOS, Linux, Android.   

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

Client Support:  Supported on Windows, macOS, Linux, Android.   

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

Client Support:  Supported on Windows, macOS, Linux, Android.   

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.

 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.JSPrintManager

The Client-side component

 Download JSPrintManager Client App

 White 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!

  Android app is not currently available for custom branding!

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


The About Dialog JSPrintManager White Label About Dialog in Windows
The Binaries - Your Brand Folder & Icons JSPrintManager White Label Windows Binaries.png
The Windows Installer Welcome Page JSPrintManager White Label Installer.png
The Windows Installer Progress Page JSPrintManager White Label Installer Progress.png

 Your White Label App under macOS


The About Dialog JSPrintManager White Label About Dialog in macOS
The App - Your Brand Icon JSPrintManager White Label macOS App.png
The macOS Installer Welcome Page JSPrintManager White Label macOS Installer.png
The macOS Installer Summary Page JSPrintManager White Label macOS Installer Summary.png

 Your White Label App under Linux


The About Dialog JSPrintManager White Label About Dialog in 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.

 Windows   Linux / Raspberry Pi   macOS / OSX

Any 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.

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 languagePrinter brandsTypical useBlazor (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)


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
PDF 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

 Corporate Proxy

 Citrix

 Windows Kiosk Mode

 iOS, ChromeOS & Android

 Printer setup for raw commands


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() and AddInteractiveServerRenderMode() in Program.cs, and add @rendermode InteractiveServer to 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 LocalNetworkAccessAllowedForUrls policy. 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.