You export a barcode PNG at 900 pixels wide. It is sharp enough to read individual modules. You drop it into Microsoft Word and it expands across half the page. Congratulations: the pixels are excellent and the physical document is wrong.

This is the difference between pixel dimensions and print dimensions. Word does not care how proud you are of the first number if the second one is missing.

The missing pHYs chunk

A PNG can include a pHYs chunk describing pixels per meter. That is how Word, Figma and other layout tools know the intended physical size. A browser canvas export usually gives you pixels without that physical claim, or a viewer assumes 72/96 DPI.

At 96 DPI, a 900-pixel image is 9.375 inches wide. At 600 DPI, the same image is 1.5 inches wide. The bitmap did not change; the interpretation did.

Our single-label PNG exporter writes 23622 pixels per meter—600 DPI—into the PNG byte stream. The bulk barcode generator uses the same principle when it creates a ZIP of labels. Drop one into Word and it lands at real label size instead of becoming a poster.

Why this matters more for barcodes than photos

A product photo can be 20% larger without hurting anyone. A UPC-A has a nominal width of 37.29 mm at 100% magnification. Its narrow module is 0.330 mm. If Word scales it arbitrarily, the bars and quiet zones may no longer match the intended magnification.

This is why a high-resolution PNG is not automatically a print-ready PNG. You need both:

  • enough pixels to keep narrow bars crisp;
  • metadata that says how large those pixels should be on paper.

The UPC-A label generator handles the second part while the export keeps the module width tied to the PDF engine. The EAN-13 generator follows the same rule.

When SVG is the better answer

If the destination supports vector artwork, SVG avoids the DPI metadata problem in a different way: paths have dimensions, and scaling stays mathematical. But SVG is not a magic fix for thermal printing. A 203 DPI printhead still has to turn those paths into whole heating dots. For that physical constraint, see the 2 × 1 in thermal label generator, where module widths are snapped to printer dots.

The takeaway is pleasantly unglamorous: do not judge an export by zooming into it. Paste it into the program the user actually uses and measure it there. Screenshots tell you the pixels are pretty. Metadata tells you whether the sticker fits.