Menu

One layout engine for the phone and the browser: how we made label printing come out the same everywhere
📰

One layout engine for the phone and the browser: how we made label printing come out the same everywhere

DEV Community: esbuild·Вера Саенко·1 day ago
#w1VwFord
#devtoesbuild#devto#dev#code#layout
Reading 0:00
15s threshold

Disclosure. I work on ChZ Scanner, an Android app and a web workspace for Russia's product marking system. This post is about one engineering problem we hit while building it; the app is linked at the end.

The problem

Our users print labels with a DataMatrix code, a product name, dates and a counter. They print from a React Native app (to a Zebra printer over ZPL, or to PDF) and from a web page (to the browser's print dialog). A user designs the layout in the app and expects every printout to look exactly like the preview. For weeks they did not: the same layout came out different on the phone and on the website, and sometimes different from the preview itself.

What was wrong

Two layout implementations. The site had a simplified label builder; the app had the real one. Anything the simplified one did not know (a name, dates, side-by-side text) silently disappeared.

Data-dependent layout.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.