A silent print job that spits out blank labels is almost never the printer's fault: the script hid the print dialog before it set the page size, so the job lost the media settings the dialog used to supply. Anyone wiring barcode label printing into an HMI button, a PLC recipe change or an end-of-line print station runs into this within the first hour of going silent. This guide shows where a default letter page puts your barcode on a roll printer, how to measure the label and set page width and height in the script, and how to prove the printed codes scan before the batch ships.
Why do labels print blank once I hide the print dialog?
The labels come out blank because suppressing the dialog discards the driver's recommended settings, and a job that never set a page of its own falls back to a 215.9 × 279.4 mm letter sheet that lays the barcode down where no label ever is.
The dialog is not decoration. While it is open, the driver fills in media size, origin and margins from the stock actually loaded in the printer. Suppress it and the only page definition left is whatever the script itself carries. Nothing raises an error: the job prints, the printer feeds, and a blank die-cut label drops into the bin — which is why a bare except that swallows the traceback makes the whole fault look like nothing happened.
Two symptoms separate the fault families. A consistently blank label points at page setup, because placement is the only thing the dialog was fixing. A smeared or half-clipped symbol points at media handling or print darkness instead.
What page size does a silent print job use if the script never sets one?
A suppressed job keeps whatever page the script programmed, and a script that never calls a page-size method inherits the print system's default sheet — 8.5 × 11 in, which works out to 215.9 × 279.4 mm — no matter what is loaded in the label printer.
That default is correct for an office sheet printer, which is exactly why the same script prints fine there and fails on the roll printer. With the dialog open, the driver was silently substituting the stock size set in the printer — the roll's die-cut size, 57 × 32 mm — every single time. Remove the dialog and the 279.4 mm sheet takes over. The fix is therefore not a driver reinstall or new firmware: it is making the script state the page explicitly, so the job is identical with and without the dialog.
If the print trigger lives in the controller instead of a screen, the PLC-side label printing method hands you the same page problem — solve it once, in the one place that owns printing.
How far off the label does a letter-size page put the barcode?
On a 279.4 mm tall page, a vertically centred symbol starts 130.6 mm from the top — 98.6 mm past the end of the label — so the printhead never sees it and every pass ejects a blank.
Take the measured barcode roll and a minimum-specification 1D symbol, 18.3 mm of bar height, and follow the placement through:
The symbol lands roughly 100 mm below the label area. A die-cut printer feeds one label at a time and images only while media is under the head; the misplaced content paginates onto a page 2 that does not exist on a roll, so nothing lands on any label. With the dialog open, the driver's stock size had put the same symbol dead centre — that asymmetry is the fingerprint of this fault.
How do I measure the label and set page width and height in the script?
Measure the die-cut opening across and down, then pass those numbers as the job's page width and height, in the unit the job object expects, before you call setShowPrintDialog(0).
- Peel one label back and measure the die-cut opening, not the liner. Record width and height to the nearest millimetre: 57 × 32 mm for the roll used here.
- Find the page-size calls in your print script. The screen-side print job object exposes setPageWidth and setPageHeight alongside the calls your script already makes.
- Set the page before the dialog flag: width and height first, then orientation and printer name, then setShowPrintDialog(0) last.
- Convert the unit if your API expects points: 1 mm = 2.835 points (72 pt / 25.4 mm), so this label is 161.6 × 90.7 points.
- Print one label silent and one with the dialog open, and compare where each symbol sits on the liner.
# Die-cut label: 57 mm wide x 32 mm tall, measured on the liner
# Method names are the screen print API; the numbers are the measured label
job = system.print.createPrintJob(event.source.parent.getComponent('Barcode'))
job.setPageWidth(57) # label width, set first
job.setPageHeight(32) # label height, set second
job.setOrientation(0) # portrait
job.setPrinterName("ShopFloorLabelPrinter") # exact name in the OS printer list
job.setFitToPage(1) # safe now that the page is the label
job.setShowPrintDialog(0) # silent, only after page setup is complete
job.print()
If the API works in points, pass 161.6 and 90.7 instead of 57 and 32 — one test print with a ruler settles the unit. The printer name string must match the operating system's list exactly, or the job silently routes to the default device.
| Common die-cut rolls | Page in mm | Page in points (mm × 2.835) |
|---|---|---|
| Barcode roll | 57 × 32 | 161.6 × 90.7 |
| Address roll | 89 × 29 | 252.3 × 82.2 |
| Shipping roll | 102 × 152 | 289.2 × 430.9 |
Labels fed with serial data from the controller rather than a screen component — the ASCII-to-printer serial path — need the page set on the printer side all the same.
How do I set margins, orientation and fit so the barcode stays inside the label?
Centre the symbol and protect a quiet zone of at least 10 module widths — 2.6 mm per side at the 0.26 mm minimum module size — which leaves 22 mm of spare width on the label carrying a 29.8 mm minimum-width symbol.
Work the margins from the die-cut outline, not from the artwork. A minimum-width 1D symbol with quiet zones needs 29.8 + 2 × 2.6 = 35 mm of width and 18.3 mm of height, so the die-cut holds it with (57 − 35) / 2 = 11 mm of side margin and 13.7 mm of vertical margin to spare. Leave fit-to-page off unless the page already is the label: on a 279.4 mm sheet it scales the artwork to fill a page the printer cannot image. Keep orientation portrait on roll-fed stock, because the printer feeds the short edge and a landscape call rotates the artwork 90° into the label's narrow direction.
If the same station also prints paperwork, split labels and documents into separate jobs so a first-page-only trick — the print the first page only method — never decides where the barcode lands.
Why does the same job print on a sheet printer but come out blank on the label printer?
A sheet printer images the full 215.9 × 279.4 mm page, so the misplaced symbol prints mid-sheet and the test looks healthy; a die-cut label printer can only image the label area, so the identical job produces a blank.
The asymmetry also explains why the fault appears on the day you go silent rather than the day you wrote the script: nothing in the layout changed, only who supplies the page. Gap-fed media with nothing imaged on it simply passes under the head, and roll printers rarely raise a mismatch to tell you.
How do I check that the printed labels scan before they reach the line?
Print ten labels from the silent job and read all ten the way the line will — a fixed code reader at the working distance and angle — because a symbol that decodes at the bench survives the conveyor and one that only a phone camera finds does not.
A compact reader mounted over the printer output turns that spot check into a continuous one: every label is decoded as it leaves the printer, and a failed read can hold the batch. Reading at the point of printing catches all three silent-print failure modes at once — the symbol off the label, a quiet zone clipped by a margin, and bars thinned or thickened by scaling. For a station that has to judge labels without a screen, the standalone verification approach keeps the judgement inside the reader, and the bottle-label verification build wires the same check to a PLC over serial.
- Resolution
- Up to 3 MP
- Shutter
- Global
- Interface
- USB
The LS-CRD-0047 is a compact fixed industrial barcode reader with a 1.2 MP sensor on USB 2.0, rated for 60-120 mm reading distances, which suits a bench check beside the printer with no network work.
At 90 mm above the label, the mid-point of that range puts the whole die-cut inside the reading zone. Where codes are dense or the station already reports over Ethernet, step up a resolution class:
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.7"
- Shutter
- Global
The LS-CRD-0028 pairs a 2560 × 2048 sensor with an 8 mm lens, reads 60 codes per second and reports over Fast Ethernet.
Over the 57 mm-wide label that sensor resolves the quiet zone as well as the bars, so a margin that clips the clear area fails the check instead of slipping into the field.
When is a blank label something other than page size?
If blank labels persist after the page size is set, work down four causes in order of likelihood: the driver's stock setting, a swallowed script error, a printer name mismatch, and the component itself.
- Driver stock mismatch. The driver's own default page — under Printing Defaults, behind the Advanced tab in Page Setup — is what a silent job inherits when a value is missing, so set the stock there to the same die-cut size the script passes and both ends agree.
- Swallowed error. A bare except that ends in a constant throws away the traceback, and a script that fails early prints nothing at any page size. Strip the handler for one run, read the error, then restore handling that logs instead of hiding.
- Printer name mismatch. A setPrinterName string that differs by one character from the operating system's list routes the job to the default device, often the sheet printer, which prints it mid-page and looks like success. Open the OS print queue after a silent job: the label printer should show one completed job per label.
- The component itself. If labels come out blank with the dialog open too, page setup was never the fault: the barcode component is empty, zero-sized or unrendered at print time. Print a fixed test payload once to separate artwork faults from job faults.
Prevention is one rule and one match: the script sets page width and height before it suppresses the dialog, and the driver's stock matches the script's numbers. Re-run the ten-label read check after any driver, firmware or artwork change, and mount the check reader properly — the reader accessories range covers the mounting and lighting bits, filtered at the accessories finder.
For the reading side of a new print station, start at the fixed code readers category or the code reader finder; the code-reading topic page collects the decoding and wiring guides that come after printing works.
1D/2D codes on the line
658 models · from $399.00Questions
How do I tell whether my print API wants points or millimetres?
Set the page size to the measured label, print once, and check what the driver reports for the page. If you passed 57 and the report says about 20.1 mm, the API took points (57 / 72 × 25.4 = 20.1 mm); if it says 57 mm, the API took millimetres. Convert with 2.835 points per millimetre and the unit is settled for every job after that.
Where do I set the driver's stock size so silent jobs inherit it?
In the driver's Printing Defaults, not the printing preferences: open the printer list, open the label printer's properties, go to the Advanced tab, choose Printing Defaults and set the Page Setup stock to the measured label size. Preferences govern jobs that show a dialog; defaults govern jobs that never ask, which is exactly the silent path. Match these numbers to the script and both routes print the same page.
What fixes a label where the barcode prints but sits shifted or rotated?
Two suspects: the origin and the orientation call. Die-cut stock presents its top edge as the page origin, so any top margin shifts the symbol down by that amount — set margins to zero and orientation to portrait first. Then raise margins one millimetre at a time until the symbol sits centred; a 90° rotation means the orientation value disagrees with how the stock feeds.
Does fit-to-page stretch my barcode past the symbology's size limits?
It can. Fit-to-page scales the component to whatever page the job carries, so a page larger than the artwork thickens the bars. Keep the module width inside the symbology's printed range of 0.0104-0.0260 in (0.26-0.66 mm); beyond the top of that range, industrial scanners tuned for the standard start to miss reads. With the page set to the label and the symbol sized to it, leave fit-to-page off entirely.

