Skip to content
WiFiLabel

Raspberry Pi CUPS Zebra wrong label size

The CUPS default is not this job's page size. In Pirate Ship, use a 4 by 6 inch label. Set the queue PageSize to the 4 by 6 name from lpoptions, leave fit-to-page off, then check the GK420d's own label length and print one label.

A Pi print server can hand a phone's 4x6 label to a GK420d at the wrong size. The queue default applies when the job does not name a size and the file does not contain one.

The same mismatch on a computer, without the Pi, is Zebra printing the wrong label size. A USB GK420d does not show up on a phone by itself. Print shipping labels from an iPhone. On this setup the phone is printing to the queue the Pi shares. CUPS documents sharing that queue with other computers and mobile devices.

A Pi plus CUPS is the DIY row on make a USB label printer wireless. The printer's ports and driver are on Zebra GK420d.

Why the size is wrong#

Pirate Ship's labels are PDF files. The print screen offers letter-size 8.5 by 11 inch layouts and a 4 by 6 inch layout. A letter PDF is a letter page, even when the roll is 4 by 6.

CUPS cupsd.conf sets DefaultPaperSize for a new queue. The default is Auto. The man page says the usual names for a specific size are Letter and A4.

A job can still name its own media. RFC 8011 says a Job Template attribute supplied by the client is the behavior for that job. When the client omits it, the printer default applies, unless the document already contains that instruction. Setting the queue default does not rewrite a job that already asked for Letter or A4, and it does not change the page size inside the PDF.

lpoptions saves defaults for the lp and lpr commands. As root, that file is /etc/cups/lpoptions. For anyone else, it is ~/.cups/lpoptions, and it belongs to that user. The PPD default on the queue is what lpadmin sets.

The PPD lists the sizes the queue can use. CUPS includes drv:///sample.drv/zebra.ppd as the Zebra ZPL driver, plus EPL1, EPL2, and CPCL drivers. In the sample driver file read on November 18, 2026, w288h432 is labeled 4.00 by 6.00 inches and is 288 by 432 points. The marked default on the ZPL, EPL1, EPL2, and CPCL models in that file is w288h360, labeled 4.00 by 5.00 inches. Custom sizes with no unit are also in points. Custom.4x6in is the inches form, and only when PageSize lists Custom.

Those points are not the print head. The GK420d user guide lists 203 dpi. At 203 dpi, 4 by 6 inches is 812 by 1218 dots.

fit-to-page scales the document to the page. CUPS says the default is the size in the file, and that a file with no size may scale wrong. Fitting an 8.5 by 11 inch page onto a 4 by 6 inch page scales that page down.

A raw queue is a different path. lpadmin -m raw clears the PPD, so there is no PageSize to apply. lpr -l is the same as -o raw: the file is sent with no filter. The GK420d user guide says the printer uses ZPL and EPL. A PDF is neither. Raw does not turn a letter PDF into a 4 by 6 ZPL label.

The printer also keeps its own length. GK420d media sensing can switch to continuous mode if it does not see a gap or mark within the default 39 inches. Print width has to be set the first time you use the printer and again when the media width changes. That length is not the CUPS PageSize.

Fix it#

Replace queue with the name from lpstat -p. lpadmin may ask for the CUPS password.

  1. In Pirate Ship, set the label size to 4 by 6 before you buy the label. Settings, then General Settings. The size applies to later purchases. A label that was bought at another size has to be refunded and bought again. On the print screen, choose the 4 by 6 format, not an 8.5 by 11 inch layout. Pirate Ship says UPS labels are 4 by 6 only.
  2. On the Pi, list the sizes and the current setting with lpoptions -p queue -l. Set the PPD default to a 4 by 6 name from that list. The CUPS admin guide sets a PPD option with lpadmin -p queue -o PageSize=NAME. Its example is PageSize=Legal. For the sample Zebra driver, that is lpadmin -p queue -o PageSize=w288h432. The print-time name is media. The man page stores a print-time default as lpadmin -p queue -o media-default=w288h432. If Custom is in the PageSize list and no 4 by 6 name is, use Custom.4x6in.
  3. Do not add fit-to-page for a 4 by 6 PDF. CUPS uses the size in the file unless you ask it to scale. If a saved option has it, remove it with lpoptions -p queue -r fit-to-page. Run that as root when the option was saved for all users. A normal user's lpoptions file is what lp and lpr use for that user. Pirate Ship's Edge steps on Windows say Actual Size. Their print article also mentions Fit to Page or 100% scale for margins. On this queue, leave fit-to-page off so a 4 by 6 PDF is not scaled.
  4. Zebra's CUPS note says to pick the command language, ZPL or EPL2 for a GK420d, and to select the media size in Set Default Options. Language choice is EPL vs ZPL. Then check the printer, not only the queue. Calibrate a Zebra label printer. The user guide prints a configuration label by holding Feed until the status light flashes once, then releasing. Read the print width. If the printer has switched to continuous media, calibrate on the roll you loaded.
  5. Print one label before a batch. Pirate Ship can reprint a label you already bought, and it has a Print Test Label for plain paper. Then print one thermal label. It should be 4 by 6 inches, and one Feed press should feed one label. Stop there if the size is still wrong.

Sharing is what lets the phone see the queue. CUPS uses cupsctl --share-printers and lpadmin -p queue -o printer-is-shared=true. Zebra's CUPS note also has a Share this printer checkbox on the add-printer page at http://localhost:631.

The button below sets print width and label length on a printer plugged into a computer. It does not change the CUPS queue on the Pi.

WiFiLabel Bridge support for a GK420d is in testing. This page does not include Bridge setup steps.

FAQ

Why is the label still the wrong size after the CUPS default is 4 by 6?

A job can name its own media. RFC 8011 uses that value for the job. The printer default is used when the job omits it and the file has no size of its own. Pirate Ship's letter layout is for 8.5 by 11 inch paper. Pick the 4 by 6 format, then set PageSize from lpoptions.

What is w288h432?

In the CUPS sample Zebra driver read on November 18, 2026, w288h432 is the 4.00 by 6.00 inch choice, 288 by 432 points. The marked default in that file is w288h360, 4.00 by 5.00 inches. Points are not the GK420d's 203 dpi. At 203 dpi, 4 by 6 inches is 812 by 1218 dots. Read the name with lpoptions before you set it.

Will a raw queue print the right size?

lpadmin -m raw clears the PPD, so the queue has no PageSize. lpr -l sends the file with no filter. A GK420d expects ZPL or EPL, not a PDF. Use the language driver and set PageSize.

How do I test one label before a batch?

Pirate Ship can reprint a label you already bought, and it has a Print Test Label for plain paper. Print one thermal label and check that it is 4 by 6 inches before you print the rest.

Sources

Related guides

Drivers, specs, and network options for the models on this page.

Related

More help

Get printer fix notes

A note when we test one of these fixes on a real printer. No account.

We store the address, the page, and whether you want Auto-Print news. Privacy

Free and open source (MIT). GitHub. Made by WiFiLabel

Zebra, ZPL, and Link-OS are trademarks of Zebra Technologies. Not affiliated with Zebra Technologies.

This page uses Vercel Web Analytics. We record tool actions such as connect and calibrate. Analytics never include serial numbers, IP addresses, or label text. A label preview is sent to Labelary only while that checkbox is on.