# QZ Tray Alternative: Move Web App Printing to an API

> Looking for a QZ Tray alternative? Compare local browser bridges with a cloud printing API, then build reliable PDF and RAW printing from your backend.

Published 2026-11-23 · https://printscaler.com/blog/qz-tray-alternative-web-app-printing

![Laptop and tablet sending print jobs through a cloud service to an office printer and a thermal label printer.](https://printscaler.com/blog/images/qz-tray-alternative-web-app-printing-29.jpg)

A QZ Tray alternative makes sense when printing should happen from your backend rather than depend on a browser-to-printer connection. PrintScaler takes that approach: your server sends an HTTPS request, and an agent at the destination delivers the job to a physical printer. The important choice is not just which tool prints a PDF—it is where your printing workflow should run.

## What are you trying to replace in QZ Tray?

QZ Tray connects web applications with local printers through a locally installed application. That architecture is useful when someone is working at a desktop and the web application needs access to that workstation’s printing environment.

But teams often reach a different requirement as their application grows:

- Print a packing slip when payment clears, even if nobody has the order screen open.
- Send documents from a background worker to a warehouse printer.
- Let a tablet submit an order while another computer handles printing.
- Track print jobs centrally instead of treating printing as a browser-side action.
- Keep printer credentials and routing decisions out of frontend code.

These requirements point toward backend-driven printing. Your application records a business event, selects a destination, and submits a print request independently of the page that initiated the action.

**PrintScaler is an architectural alternative, not a drop-in replacement for QZ Tray’s JavaScript API.** You change the application’s print boundary from a local browser bridge to an authenticated HTTPS request from your server.

## QZ Tray vs. a cloud printing API

Both approaches can connect business software with physical printers. The difference is how your application reaches those printers and which component coordinates the work.

| Decision point | QZ Tray approach | PrintScaler approach |
|---|---|---|
| Application connection | Web application communicates with a local printing bridge | Backend submits an HTTPS print request |
| Where printing starts | Commonly in the browser workflow | Backend endpoint, worker, scheduler, or business event |
| Destination setup | Local application and printer configuration | PrintScaler agent and operating-system printer configuration |
| Browser dependency | Browser participates in submitting the local print operation | Browser is not required after the backend has accepted the action |
| PDF and printer-language jobs | Depends on the integration and printer configuration | PDF plus RAW payloads such as ZPL, EPL, and ESC/POS |
| Remote destination | Requires an architecture that reaches the intended printing environment | Agent connects outbound from the destination computer |
| Status integration | Evaluate against your application’s monitoring requirements | Job states, history, and signed webhooks |
| Internet interruption | Evaluate the local application and document availability | New cloud requests require connectivity; submitted jobs can queue while the destination computer is offline |

This is an architecture comparison, not a claim that one option is universally better. A desktop-focused application with a strong local workflow may have little reason to change. A SaaS product with background events and distributed destinations has a different set of priorities.

For the broader browser behavior question, see the guide to [silent printing from a browser](https://printscaler.com/blog/silent-printing-from-browser).

## When PrintScaler is a good QZ Tray alternative

### Your backend owns the business event

Consider a shipping workflow. An order becomes ready for fulfillment after a payment event and an inventory check. Neither event necessarily happens while a warehouse employee has the order page open.

A backend printing API fits this workflow because the same application process can create the packing slip, select the warehouse printer, and submit the print request. The browser becomes an optional control surface rather than the component responsible for delivery.

### Your users work on tablets or different workstations

A tablet user might need to send a document to an office printer connected to a Windows computer. With a backend-driven design, the tablet sends a normal application action to your server. Your server chooses the configured destination.

That does not make every printer directly cloud-connected. For ordinary printers, the destination still needs a computer running the PrintScaler agent. Supported Epson Server Direct Print receipt printers are a separate option that can connect without a computer.

### You need centralized operational visibility

A successful API call and a completed physical task are different events. Teams need to know whether a request was accepted, whether the destination was offline, and whether an error occurred later.

PrintScaler exposes print-job states and history, plus webhooks for job, computer, and printer events. This gives your application a central place to build an operations view without making an open browser tab the source of truth.

## When you should keep a local printing bridge

Switching is not automatically an improvement. Keep your existing approach, or test carefully before changing it, when these conditions apply:

- **Local operation during an internet outage is essential.** A local bridge may support an appropriate local workflow when the application and print data remain available. A cloud API cannot accept a new request from a disconnected client.
- **The user deliberately selects among workstation printers.** Moving selection to backend routing may add configuration your users do not want.
- **Your integration depends on other local-device functionality.** Replacing printing does not automatically replace peripheral access or every local integration.
- **The existing workflow is stable and meets your requirements.** An architectural migration needs a concrete benefit, not just a different API.

Also distinguish “no browser print dialog” from “no installed software.” PrintScaler’s standard agent-based route removes the browser from printer delivery, but it does not remove the destination agent.

## How to replace browser-initiated printing with PrintScaler

The following example migrates a packing-slip workflow. The same architecture applies to invoices and other PDFs; RAW label and receipt payloads use different content types.

### 1. Connect the destination printer

Install the printer through the destination computer’s operating system and confirm that a normal local test page works. A cloud service cannot correct an incorrect printer driver, a disconnected USB cable, or a paper jam.

Next, [download the PrintScaler agent](https://printscaler.com/download) for Windows, macOS, Linux, or Raspberry Pi. Install it, then enter the pairing code in the dashboard to link the computer.

The agent starts automatically after reboots, updates itself, and connects through an outbound WebSocket. You do not need to expose an inbound printer port for this connection.

Use the dashboard’s test-page button to verify the path, then record the destination printer ID. Your application will use that ID when submitting jobs.

### 2. Move printer routing into your backend

Avoid accepting an arbitrary printer ID from a browser and forwarding it without authorization. A user who can change a request body should not gain access to another customer’s printer.

Instead, store a server-side mapping such as:

| Application setting | Example value |
|---|---|
| Organization | Example merchant |
| Location | Main warehouse |
| Document purpose | Packing slip |
| PrintScaler printer ID | `123` |

When a user requests printing, your backend checks their access to the order and location, then resolves the printer from this mapping.

For a single-printer prototype, an environment variable is sufficient. For a multi-tenant product, use tenant-scoped database records and administrative controls.

### 3. Generate the document on the server

Keep your existing PDF generator if it already produces suitable output. You do not need to redesign a packing slip simply because its transport changes.

PrintScaler accepts a PDF through either of these content types:

- `pdf_base64`: the PDF bytes encoded into the JSON request.
- `pdf_uri`: a URL from which the document can be retrieved.

Base64 is convenient when the backend already holds the finished PDF. A URI avoids embedding the document bytes in the request, but the document must remain retrievable when needed. Do not use a browser-only blob URL or a private session URL that the service cannot access.

For sensitive documents, choose the delivery method according to your application’s access controls and data-handling requirements.

### 4. Submit the print request from Node.js

This server-side example uses Node.js 20 or later and its built-in `fetch`. It assumes your application has already authorized the action and loaded the finished PDF into a Buffer.

Store the API key in a server-side secret or environment variable. Never put it in frontend JavaScript.

```javascript
// printing.mjs
export async function submitPackingSlip({
  pdfBuffer,
  orderReference,
  printRequestId
}) {
  const apiKey = process.env.PRINTSCALER_API_KEY;
  const printerId = Number(process.env.PRINTSCALER_PRINTER_ID);

  if (!apiKey || !Number.isSafeInteger(printerId) || printerId <= 0) {
    throw new Error("Missing or invalid printing configuration");
  }

  if (!Buffer.isBuffer(pdfBuffer) || pdfBuffer.length === 0) {
    throw new Error("A nonempty PDF Buffer is required");
  }

  if (!printRequestId) {
    throw new Error("A persisted print request ID is required");
  }

  const response = await fetch(
    "https://api.printscaler.com/v1/printjobs",
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${apiKey}`,
        "Content-Type": "application/json",
        "X-Idempotency-Key": printRequestId
      },
      body: JSON.stringify({
        printerId,
        contentType: "pdf_base64",
        content: pdfBuffer.toString("base64"),
        title: `Packing slip ${orderReference}`
      }),
      signal: AbortSignal.timeout(15000)
    }
  );

  if (!response.ok) {
    throw new Error(`Print submission returned HTTP ${response.status}`);
  }

  return response.text();
}
```

The function returns the response body without assuming a particular response shape. Use the [print-job API reference](https://printscaler.com/docs#printjobs) to integrate the documented response into your application’s records.

The timeout stops your application from waiting indefinitely; it does not prove that the remote request was rejected. If the connection fails after acceptance, retry the same logical request with the same idempotency key.

### 5. Persist the printing intent before sending

Create a print-request record in your database before calling the function. Store its unique identifier, destination, document reference, and business purpose.

Use that persisted identifier as `printRequestId`. Do not generate a new key every time a worker retries.

A useful distinction is:

- **Retry:** same intended document, destination, and print action; reuse the key.
- **Intentional reprint:** a new authorized action; create a new record and key.

Keep the payload stable when retrying. If the document changes or the user chooses a different destination, treat that as a new printing decision rather than silently modifying an existing request.

For a deeper implementation discussion, see [how to prevent duplicate print jobs](https://printscaler.com/blog/prevent-duplicate-print-jobs).

### 6. Track delivery separately from submission

Once the API accepts a job, show a submitted or pending state—not an unconditional “Printed successfully” message.

PrintScaler job states include `new`, `sent_to_client`, `queued`, `in_progress`, `done`, `error`, `cancelled`, and `expired`. Store the relevant job information and update your application as delivery progresses.

Use [signed print-job webhooks](https://printscaler.com/docs#webhooks) for ongoing updates. Verify HMAC-SHA256 signatures and make your handler safe to process repeated deliveries, because webhooks are retried.

A reported completion state should still be interpreted within the printer and spooler’s reporting limits. It is not independent proof that someone collected the paper or that a printed barcode is readable.

## What changes for labels and receipts?

Moving away from a browser bridge does not require converting every job to PDF. Match the payload to the destination printer.

| Document | Suitable starting format | What to verify |
|---|---|---|
| Packing slip or invoice | PDF | Paper size, tray, duplex, and scaling |
| Zebra-compatible label | RAW ZPL or EPL | Printer language, label dimensions, and resolution |
| Receipt | RAW ESC/POS | Model-specific commands, paper width, and cutter support |

PrintScaler accepts `raw_base64` and `raw_uri` alongside the PDF content types. For a RAW payload, the printer must understand the bytes you send; the API does not make an incompatible printer understand ZPL or ESC/POS.

ESC/POS RAW printing is faster and sharper than printing a PDF receipt, but command support still varies by model. Test cutting, cash-drawer pulses, QR codes, and character encoding against the actual hardware before rollout.

PDF jobs support options including copies, duplex, paper size, tray, DPI, color, fit to page, and page ranges. Read printer capabilities through the API rather than assuming every destination offers identical settings.

## Reliability checks before you migrate production traffic

A working test page is only the beginning. Test the failure paths your support team will encounter.

### Disconnect the destination computer

Submit a job while the computer is offline. PrintScaler queues jobs until the computer returns, subject to configurable expiration.

Choose expiration deliberately. Yesterday’s packing slip may still be useful; a stale receipt or operational ticket may cause confusion. Queuing is not a substitute for deciding whether delayed output still has value.

### Simulate an uncertain API response

Interrupt the network after submission and retry with the same idempotency key. Confirm that your application preserves the original intent instead of creating another print action.

Separate retryable transport failures from configuration and document problems. Do not blindly resubmit a malformed payload or an invalid destination.

### Check the application’s access controls

Try submitting an order from the wrong tenant or location. The backend should reject the request before contacting the printing API.

Also keep document content out of routine logs. An invoice or shipping label can contain personal information even when its print-job title looks harmless.

### Test peak submission volume

PrintScaler’s API rate limit is 10 requests per second with a burst of 30. Use a backend queue to smooth bursts, and avoid retrying every failed request at the same instant.

Measure requests, not only pages. PrintScaler pricing is per print request rather than per page, so document grouping can affect request volume. Keep operational requirements—especially routing and reprints—ahead of attempts to minimize calls.

## Estimate the cost of the new architecture

Compare more than software subscription fees. Include agent deployment, printer setup, backend development, monitoring, support, and the consequences of missed or duplicate output.

PrintScaler’s Free plan includes 100 prints per month and one computer, making it suitable for testing this architecture with real hardware. Paid plans increase included print volume and connected-computer allowances; consult the [current pricing and plan limits](https://printscaler.com/pricing) before sizing a rollout.

An API approach is most valuable when it removes application complexity you actually have: background jobs, remote destinations, centralized status, or browser-dependent operational steps.

## Choose the architecture that fits your workflow

The strongest reason to choose a QZ Tray alternative is a change in responsibility: your backend should own printing, while browsers and tablets simply initiate authorized business actions.

Start with one document, one printer, and one persisted print intent. Validate offline behavior, retries, and status reporting before expanding. [Create a free PrintScaler account](https://printscaler.com/signup) to test that workflow on your own hardware.

## Frequently asked questions

### Is PrintScaler a drop-in replacement for QZ Tray?

No. QZ Tray integrations commonly connect browser code to a local printing bridge, while PrintScaler accepts authenticated HTTPS requests from your backend. You will need to change submission, printer routing, and status handling rather than simply replace a JavaScript library.

### Can I print without installing software on every user's computer?

With PrintScaler, the agent runs on the computer that connects to the destination printers, not necessarily every device using your application. A tablet or another workstation can initiate an authorized backend action without running the agent itself. Supported Epson Server Direct Print models can connect without a computer.

### Can a cloud printing API work if the printer computer is offline?

PrintScaler can accept a job while the destination computer is offline and queue it until the computer reconnects, subject to configurable expiration. The application submitting a new cloud request still needs internet connectivity.

### Can PrintScaler send ZPL and ESC/POS instead of PDFs?

Yes. PrintScaler supports RAW payloads through raw_base64 and raw_uri, including ZPL or EPL for compatible label printers and ESC/POS for compatible receipt printers. The destination printer must support the language and commands you send.

### How do I prevent duplicate printing when an API request times out?

Persist an identifier for each intended print action and send it in the X-Idempotency-Key header. Reuse that key when retrying an uncertain request, and create a new key only for a new intentional print action. A timeout alone does not prove the original request was rejected.
