DYMO Label Printing API: Print Labels From Your Web App

Connect a web application to a local DYMO LabelWriter using correctly sized PDFs, an installed printer driver, and PrintScaler. Learn how to test compatibility, route labels, and avoid common sizing mistakes.

By the PrintScaler team · · 9 min read

Desktop label printer producing an address label from a web application through a cloud-connected computer.

You can print DYMO labels from a web application by generating a label-sized PDF and sending it through a cloud printing API to a computer with the printer installed. With PrintScaler, the local agent connects that computer to your backend, which submits the PDF in one HTTPS request. The important prerequisite is that your exact DYMO model, operating system, driver, and label stock can already print the PDF correctly locally.

What a DYMO label printing API needs to handle

A useful integration does more than transfer a file. It must preserve the label’s dimensions, select the right physical printer, and make failures visible to your application.

Think of the workflow as four separate responsibilities:

  1. Your application creates the label. It decides what text, barcode, or image belongs on it.
  2. The PDF defines the physical layout. Its page size must match the intended label.
  3. The printing service delivers the job. PrintScaler routes it to the selected printer through the connected computer.
  4. The installed printer driver handles device output. Its paper settings and model compatibility still matter.

This separation is especially useful when your application runs on a hosted server that cannot directly access an employee’s USB printer.

A label API is not necessarily a label designer. PrintScaler accepts print-ready PDF or RAW content; your application remains responsible for generating the document.

Choose PDF for this DYMO integration

For the workflow in this guide, use PDF through the installed printer driver. Do not assume that a DYMO LabelWriter accepts the ZPL commands commonly used with Zebra printers or the ESC/POS commands used with receipt printers.

PrintScaler supports those RAW formats for compatible hardware, but RAW support does not make every printer compatible with every command language.

Approach What your application sends What you need to verify
PDF through the local driver A PDF with the correct label dimensions Driver compatibility, paper size, orientation, and readable output
Printer-specific RAW output Commands understood by the exact device Documented command-language support and an appropriate delivery path
Manual browser printing A browser-rendered page or downloaded PDF User selection of printer, paper size, and scaling on each workflow

PDF is a practical starting point when your application already produces documents or uses a PDF library. It also lets you inspect the exact label before sending it.

This is not a blanket compatibility guarantee for every DYMO device. Test your model and supported operating system before committing to a deployment.

Step 1: Prove the printer works locally

Start with the computer that will remain connected to the label printer. Choose an operating system supported by both the printer’s driver and the PrintScaler agent; the agent is available for Windows, macOS, Linux, and Raspberry Pi, but driver availability is a separate requirement.

Before involving your web application:

  1. Install the appropriate driver for the exact printer model.
  2. Load supported label stock according to the printer’s instructions.
  3. Confirm that the operating system recognizes the printer.
  4. Print a basic local test.
  5. Print a one-page PDF whose page dimensions match the label.

Use a test label containing a short address, a thin border inside the printable area, and a barcode if your workflow requires one. The border makes clipping and unexpected scaling easier to spot.

If that PDF fails locally, fix the driver or layout first. An API cannot correct an unsupported driver, an unavailable paper definition, or a document designed for the wrong stock.

Record a known-good configuration

Write down the printer model, driver version, label dimensions, orientation, and working print settings. Keep the successful PDF as a regression test.

That small record is valuable when a replacement workstation prints differently from the original one. You can compare a known-good document and configuration instead of debugging the API and printer simultaneously.

Step 2: Connect the printer through PrintScaler

Install the PrintScaler agent on the computer with the working printer installation. Link the computer by entering the pairing code in the dashboard, then locate its reported printer entry.

Use the dashboard’s test-page button as a basic connectivity check, with awareness that a generic test page may not be laid out for small labels. Your label-sized PDF remains the meaningful layout test.

The agent runs in the background, starts automatically after reboots, and connects outbound through a WebSocket. This agent-based setup does not require opening an inbound port on the store or office network.

Record the printer ID you intend to use. If the computer exposes multiple printers or duplicate queues, identify the correct one before connecting the workflow to real orders or customer records.

In your application, store a server-side mapping such as:

  • office-address-labels → the verified address-label printer ID.
  • stockroom-small-labels → the verified stockroom printer ID.

These are application-defined names, not PrintScaler API fields. They give your business logic a stable destination without embedding physical printer IDs throughout your code.

Step 3: Generate a correctly sized PDF label

The PDF page should represent one physical label, not a letter-size sheet containing a small label image in one corner.

Set these properties explicitly in your PDF-generation library:

  • Page width and height: match the actual stock.
  • Orientation: match the layout and driver configuration.
  • Margins: leave room for the printer’s usable print area.
  • Font sizes: remain readable after physical printing.
  • Barcode dimensions: suit the symbology, scanner, and intended use.

PDF coordinates commonly use points. One inch equals 72 points, so the conversion from millimeters is:

points = millimeters × 72 / 25.4

Use the dimensions specified for your stock rather than copying a nearby size from an example. Labels that look similar can still need different paper definitions.

Prefer vector text and barcodes

Where your PDF library supports it, use vector text and barcode graphics instead of a screenshot of an HTML label. Raster images can become soft when resized, especially on small stock.

Test with realistic content: long organization names, international addresses, narrow characters, and the longest barcode value you expect. A label that works with “Test Item” may clip a real inventory description.

For more background on page dimensions versus driver scaling, the PDF label sizing guide explains the same distinction using larger shipping labels. Apply the principle, not its 4×6 dimensions, to your DYMO stock.

Step 4: Send the PDF with one API request

For an initial integration, pdf_base64 avoids introducing a separate file-hosting dependency. Your backend reads the generated PDF, encodes its bytes as Base64, and sends the result to PrintScaler.

The following Node.js example uses the built-in fetch available in current Node.js releases. It is a server-side script, not browser code.

import { readFile } from 'node:fs/promises';

const apiKey = process.env.PRINTSCALER_API_KEY;
const printerId = Number(process.env.PRINTSCALER_PRINTER_ID);
const printActionId = process.env.PRINT_ACTION_ID;

if (!apiKey || !Number.isInteger(printerId) || printerId <= 0 || !printActionId) {
  throw new Error('Set a valid API key, printer ID, and print action ID.');
}

const pdf = await readFile('./address-label.pdf');

const response = await fetch(
  'https://api.printscaler.com/v1/printjobs',
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${apiKey}`,
      'Content-Type': 'application/json',
      'X-Idempotency-Key': printActionId
    },
    body: JSON.stringify({
      printerId,
      contentType: 'pdf_base64',
      content: pdf.toString('base64'),
      title: 'Address label: shipment 8421'
    })
  }
);

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

console.log('Print job submitted; inspect its subsequent job state.');

Set PRINT_ACTION_ID to a persistent identifier for this particular business action, such as shipment-8421-address-label-original. Reuse it if you retry that same submission. An intentional reprint needs a new action identifier.

Do not regenerate the idempotency key on every network attempt: doing so turns each attempt into a distinct request.

The request’s success means submission succeeded; it is not proof that the label physically emerged. Consult the API documentation for authentication, print options, idempotency, and job-state handling.

When to use a PDF URL instead

If your backend already hosts generated documents, pdf_uri is another supported content type. Set content to a PDF URL the service can retrieve, rather than Base64 content.

A URL that requires an employee’s browser session will not provide that access. For protected documents, use an appropriately controlled retrieval mechanism or submit the PDF bytes instead. Keep any temporary URL valid long enough for retrieval, and avoid placing customer information in filenames or query parameters unnecessarily.

Step 5: Add the print action to your web application

Your browser should call your own authenticated backend, and that backend should call PrintScaler. Never put the PrintScaler API key into client-side JavaScript.

A production flow can look like this:

  1. An authorized employee selects “Print address label.”
  2. Your backend checks access to the shipment and destination printer.
  3. It creates or retrieves a print-action record.
  4. It generates the PDF from trusted application data.
  5. It submits the request using that action’s idempotency key.
  6. It records the submission result and follows the job’s state.

Do not let a browser submit an arbitrary printer ID without authorization. A user who can print at one workstation should not automatically gain access to every printer your account can reach.

If your broader goal is eliminating the browser print dialog, the silent browser printing guide explains the backend-and-agent architecture in more detail.

Step 6: Track delivery, offline queues, and reprints

PrintScaler exposes job states including new, sent_to_client, queued, in_progress, done, error, cancelled, and expired, with state history. Use those states to avoid displaying “Printed” immediately after the submission request succeeds.

A useful application interface separates these concepts:

  • Submitted: your backend successfully created the print request.
  • Processing: the job is progressing through delivery and printing.
  • Completed: the service reports done.
  • Needs attention: an error, cancellation, or expiration needs review.

Those are suggested application labels, not additional API states. Even done should not be treated as independent visual proof of a readable, correctly attached label.

PrintScaler queues jobs while a computer is offline and prints them when it returns, subject to configurable expiration. Decide whether delayed printing is desirable: yesterday’s address label appearing unexpectedly this morning may be more confusing than useful.

Webhooks can notify your backend about print-job state changes and computer connectivity. Verify their HMAC-SHA256 signatures, and make your event handler safe to process retried deliveries.

Troubleshoot by separating layout from delivery

Most debugging becomes easier when you ask whether the problem exists in the PDF, the local print configuration, or the delivery path.

Symptom First checks
Label is tiny or surrounded by blank space Confirm the PDF is label-sized rather than letter-sized
Text is clipped or rotated Compare PDF dimensions, orientation, margins, and driver settings
Local printing fails too Investigate stock, driver, printer connection, and operating-system queue
Local PDF works but API output differs Verify the selected printer ID and compare effective print options
Job waits while nothing prints Check the connected computer, agent status, and job history
An unexpected second label appears Review application retries, idempotency keys, and intentional reprint actions

Printer capabilities, including reported paper sizes and DPI, are readable through the API. Inspect those capabilities before choosing options rather than guessing a paper name or assuming two driver installations expose identical values.

Do not treat fit-to-page as a universal correction. It can hide a page-size mismatch while changing barcode dimensions or margins. Start with a correctly sized document, then test the relevant scaling setting deliberately.

Costs and a practical rollout checklist

PrintScaler pricing is per print request, not per page. The Free plan includes 100 prints per month and one connected computer, making it suitable for an initial compatibility test. Check the current plans and usage pricing before estimating a production rollout.

For easier recovery, start with one label per request and one application print-action record per request. This makes retries and operator reprints easier to reason about than a large document containing many unrelated labels.

Before deployment, verify:

  • The exact printer, driver, operating system, and stock combination works.
  • Representative PDFs print locally and through the API.
  • Unauthorized users cannot select other printers.
  • API credentials remain server-side.
  • Retries reuse the original idempotency key.
  • Offline and expired jobs produce understandable application messages.
  • Intentional reprints are recorded separately.

Start with one verified label

A reliable DYMO label printing API workflow starts with a working local printer and a PDF designed for the actual stock. PrintScaler supplies the cloud-to-computer delivery path while your application controls label content, authorization, and reprint decisions.

Create a free PrintScaler account, connect your printer’s computer, and send one known-good PDF before automating the rest of the workflow.

Frequently asked questions

Can I print DYMO labels from a web application?

Yes. One approach is to generate a label-sized PDF on your backend and submit it through PrintScaler to a computer with the DYMO printer installed. First verify that your exact printer, driver, operating system, and stock can print the PDF correctly locally.

Does a DYMO printer accept ZPL commands?

Do not assume that a DYMO printer supports ZPL. Command-language compatibility depends on the exact device. This guide uses PDF printing through an installed driver rather than relying on ZPL support.

Do I need a computer connected to the DYMO printer?

For the workflow described here, yes. The computer runs the printer driver and PrintScaler agent, which receives jobs from the cloud. It must be online for jobs to reach the printer; jobs can queue while it is offline, subject to expiration.

Why are my DYMO PDF labels printing too small?

A common cause is a letter-size or A4 PDF containing a small label design rather than a PDF page matching the label dimensions. Check the document size, driver paper selection, orientation, and scaling settings. Test the same PDF locally to separate layout problems from delivery problems.

Can I call the printing API directly from browser JavaScript?

Keep the API key on your backend rather than exposing it in browser code. The browser should request an authorized print action from your server, which generates the label and submits it to PrintScaler. Validate the user's access to both the business record and the destination printer.

How do I avoid duplicate labels when a request times out?

Assign a persistent identifier to each intended print action and send it in the X-Idempotency-Key header. Reuse that key when retrying the same submission. Create a new key only for a genuinely new action, such as an intentional replacement label.

Related articles