A barcode that reads from its original image can fail after printing, folding, copying, and scanning. Increasing the generator's canvas width does not necessarily make its narrow bars wider on paper. The physical module width, printing scale, and final scan resolution determine how much useful information survives.
For delivery slips, signed forms, and returned paperwork, start with the lowest scan resolution you must support. You can then calculate a sensible trial width, reserve enough clear space, and test the complete document journey. The aim is not the largest possible barcode, but a layout that remains readable after realistic handling without accepting an incorrect identifier.
Choose module width from the lowest scan resolution
The module width, usually written as X, is the width of the narrowest element in the barcode. In Code 128, wider bars and spaces are integer multiples of that width. Bar height is a separate dimension: making bars taller does not increase their horizontal sampling.
A scan represents the printed page on a pixel grid. Estimate the number of scan pixels across one module with:
At 200 dpi, one scan pixel represents 25.4 / 200 = 0.127 mm on paper. A narrow bar only two pixels wide has little margin for blur, thresholding, or an unfavorable position relative to the sampling grid.
Use approximately 3–4 pixels per module as an initial engineering trial range, not a guaranteed reading requirement. Actual performance depends on print quality, optics, processing, and damage.
| Printed module width | Pixels per module at 200 dpi | Pixels per module at 300 dpi | Trial interpretation |
|---|---|---|---|
| 0.254 mm | 2 | 3 | Useful comparison sample, with limited margin at the lower resolution |
| 0.381 mm | 3 | 4.5 | Reasonable starting candidate for testing |
| 0.508 mm | 4 | 6 | More sampling margin, but a wider symbol |
Design for the lowest genuine capture resolution. Enlarging a low-resolution scan afterward creates additional pixels, not additional independent measurements of the printed bars.
Check the actual acquisition settings as well as the file's resolution metadata. A later export or image-processing stage can resample a scan before your decoder receives it.
Budget the complete symbol, including quiet zones
The width requested from a barcode generator may describe its entire canvas rather than its narrow bars. Padding, text, automatic fitting, and encoding choices can all affect the relationship between that canvas and the printed symbol.
For Code 128, the encoded width can be estimated from its codeword count:
Here, n counts the codewords between the start and checksum, including any code-set switching instructions. The additional terms account for the start, checksum, stop, and minimum horizontal quiet zones of 10X on each side.
Do not substitute character count blindly. Numeric pairs can occupy one codeword in the numeric code set, while other content and switching instructions change the count.
Worked example: a short numeric identifier
Suppose the payload contains twelve digits and the encoder represents them as six numeric pairs without switching code sets.
- Encoded width: 11 × (6 + 2) + 13 = 101 modules.
- Including horizontal quiet zones: 101 + 20 = 121 modules.
- At X = 0.508 mm: 121 × 0.508 = 61.468 mm, or approximately 61.5 mm.
- Each horizontal quiet zone: 10 × 0.508 = 5.08 mm.
For comparison, twelve characters encoded as twelve data codewords require 11 × (12 + 2) + 13 + 20 = 187 modules including those quiet zones. At the same module width, the total becomes 187 × 0.508 = approximately 95.0 mm.
That difference comes from encoding density, not print quality. Inspect the generated symbol's actual module count before committing the document layout.
If the available width is fixed, work backward. A 70 mm allocation for a 187-module symbol permits X = 70 / 187 = approximately 0.374 mm. At 200 dpi, that gives 0.374 × 200 / 25.4 = approximately 2.94 pixels per module.
Preserve bar edges through printing and copying
Set barcode dimensions in physical units at the final page size. Avoid generating a small raster image and stretching it until it fills a document box. That can create uneven narrow bars or softened edges before the page reaches the printer.
Vector output avoids source-bitmap scaling artifacts, although the printer still rasterizes the page. For raster output, choose an integer number of printer dots per module whenever practical.
For example, at 600 dpi:
This keeps the source rendering consistent on that printer grid. It does not guarantee alignment with the scanner grid, which has its own sampling position and optical blur.
Print at the intended page scale. A fit-to-page setting that reduces a document to 90% also reduces every module to 90% of its designed width. A nominal 0.508 mm module then becomes approximately 0.457 mm.
Keep neighboring text, rules, signatures, and decorative borders outside the quiet zones. A surrounding box offers no decoding benefit and can introduce distracting edges. Removing the box is usually simpler than maintaining enough clearance around it.
Preserve the clear margins during software cropping too. The guide to cropping barcode images while preserving quiet zones explains why a tight crop can break an otherwise readable symbol.
Separate skew, dirt, and dithering failures
These failure modes need different remedies. Treating all of them as a request for a larger image can hide the actual problem.
| Observed symptom | Likely mechanism | Useful first test |
|---|---|---|
| Clean prints fail only at the lower scan resolution | Narrow elements are poorly sampled | Increase physical module width while holding other settings constant |
| A grayscale scan reads, but the binary export does not | Thresholding or dithering changes bar and space structure | Compare both files from the same physical page |
| A mark across one part of the symbol causes failures | Too few undamaged reading paths remain | Increase bar height or move the symbol away from handling areas |
| Tilted pages fail despite sharp bars | Localization, orientation, or cropping is limiting | Inspect the full symbol boundary before changing print dimensions |
| The original image reads but the printed copy fails | Printing or document scaling changed the symbol | Measure the print and inspect narrow elements at magnification |
Greater bar height can provide more alternative reading paths around localized dirt. Trial heights such as 15 mm, 20 mm, and 25 mm are useful experimental choices, not universal specification limits. A crease crossing the full height can still damage every available path.
Dithering converts tones into spatial patterns. Those patterns can interrupt solid bars or introduce dark points inside spaces. Where the workflow permits it, retain a grayscale scan for diagnosis and compare it with the production binary output.
For image-side remedies, use the preprocessing guide for rotation, blur, and glare. If angle correction itself is inconsistent, the explanation of deskew angle ambiguity addresses that separate issue. Neither operation can reliably reconstruct narrow elements already lost during acquisition.
Test the complete print-to-scan path
A useful trial changes one variable at a time and preserves the production workflow. Testing only a freshly generated image measures the encoder and decoder, not the document process.
- Freeze the payload and layout. Use representative identifier lengths and character patterns. Record the encoder settings and generated module count.
- Print several module widths. Begin with the trial widths in the table, using identical bar heights and clear margins. Measure the paper copies.
- Capture clean references. Scan each layout at the supported resolutions and keep the unmodified files.
- Apply repeatable handling cases. Use separate samples for folds, light soil, handwriting near the symbol, and copying. Keep an untouched reference.
- Exercise page orientation. Test planned skew angles without clipping the symbol. Include both clockwise and counterclockwise rotation.
- Run the normal export path. Include the actual grayscale, binary, compression, or document-extraction settings used downstream.
- Record the exact decoded value. Distinguish a correct first-pass read, a no-read, and an incorrect accepted identifier.
- Inspect failures before changing settings. Decide whether bars are missing, margins are clipped, or localization failed. Change the relevant variable only.
A manageable matrix might contain three module widths, two scan resolutions, five angles, and two output modes:
For the angle set, you might use 0°, +2°, -2°, +5°, and -5°. These are example test conditions; replace them with the range observed in your process.
Do not treat repeated scans of the same page as independent evidence about all future paperwork. Add different print batches, identifier lengths, and real returned documents before release.
Define acceptance before testing. A no-read routed to manual review is different from an incorrect identifier automatically attached to an order. The guide to judging barcode read confidence helps separate decoding success from trustworthy acceptance.
Change capture hardware only when it addresses the bottleneck
If your application decodes existing document files, replacing a physical reader does not repair those files. Improve the print layout, scan settings, or image pipeline first.
A dedicated station becomes relevant when you can capture the paper directly before copying or filing. Compare fixed code readers for dedicated code acquisition with smart cameras and vision sensors when the station must also inspect other document features. Confirm the required tools and interfaces for the selected device.
The LS-CRD-0028 is a fixed-reader candidate for that physical capture route.
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.7"
- Shutter
- Global
The LS-SMC-0063 is a smart-camera candidate for a broader inspection station. Verify the required barcode functionality in its documentation before selection.
- Interface
- GigE
- Resolution
- Up to 3 MP
For a camera-based layout, estimate the required horizontal sampling from the full field of view, not just the barcode width:
This is a sampling estimate, not a decoding guarantee. Focus, contrast, distortion, and processing still matter. The field of view must include the symbol, quiet zones, and expected position variation.
Use the camera finder to compare capture options after establishing the geometry. For the software path from acquisition to accepted data, consult camera-based barcode decoding and validation.
Know when wider bars are the wrong answer
Wider modules consume page width. If your software shrinks the completed symbol to fit the original box, the apparent improvement disappears. Shortening the encoded identifier can be more effective than enlarging the canvas.
Use a compact, stable lookup key when the workflow permits it. Keep human-readable text available for exception handling, but do not assume that text can reconstruct a damaged barcode automatically.
A second symbol in a separate handling area can provide another reading opportunity. Both copies should identify the same document, and conflicting reads should trigger review. Redundancy is less useful when a single fold, crop, or export operation damages both copies together.
A two-dimensional symbology may offer error correction and a different footprint, but it still needs adequate module sampling and compatible readers. Compare it through the same document trial rather than assuming error correction will overcome every crease or scan artifact.
Larger raster images can also interact poorly with a particular decoder's search strategy. The guide to downscaling before barcode decoding covers that software case. It is not a reason to print undersampled narrow bars.
Check the layout before release
Use this checklist to turn the trial into a controlled document specification:
- Physical module width recorded: specify the printed dimension, not only the generator's image width.
- Encoding mode checked: confirm the actual codeword count for the longest permitted payload.
- Quiet zones reserved: keep horizontal margins clear of borders, handwriting, and neighboring content.
- Bar height tested separately: choose it from handling and scan trials rather than stretching the whole image.
- Page scaling controlled: verify print, copy, and export stages do not silently shrink the symbol.
- Lowest-resolution route passed: test the weakest supported acquisition path, not only the best one.
- Damaged samples included: cover realistic folds, marks, and copy generations without assuming one sample represents all damage.
- Exceptions defined: route no-reads, conflicting copies, and unexpected identifiers to a documented review process.
- Configuration retained: save representative files and settings so future changes can be compared with the accepted baseline.
Choose the smallest layout that passes your defined workflow with useful margin. If direct paper capture is part of the solution, start the camera configuration process. For help reviewing a proposed layout or capture station, use application support with the physical dimensions, scan settings, and representative failure files.
Questions
What module width should I test for documents scanned at 200 dpi?
There is no universal width that guarantees a read. For initial trials at 200 dpi, consider 0.381–0.508 mm, corresponding to approximately three to four scan pixels per narrow element. Select the final width only after testing printing, copying, handling, and the production image-export settings.
Does increasing the barcode image width improve readability?
Only if the change increases the physical width of the narrow elements on paper. A wider canvas might instead add padding, or the document application might shrink it back into the same box. Check the generated module count and measure the completed print before judging the change.
How much blank space should surround a Code 128 barcode?
Code 128 needs horizontal quiet zones of at least ten module widths on each side. Leave additional layout clearance where signatures, page cropping, or print registration could intrude. Keep decorative frames outside those margins, and preserve the quiet zones when extracting the barcode from a scanned page.
Will taller bars help with dirty or folded documents?
Additional height can leave an undamaged horizontal reading path when a small mark obscures only part of the bars. It does not improve horizontal sampling or restore spaces merged by scanning. Test height independently from module width, using damage patterns representative of the returned paperwork.
Should I replace a one-dimensional barcode with a two-dimensional code?
Not without a comparison trial. A two-dimensional format can provide error correction, but its modules still need sufficient sampling and contrast. Reader compatibility, available page area, damage location, and processing settings all affect the decision. Compare both formats through the same print-to-scan workflow.

