Linux command
dmtxwrite 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Encode text as Data Matrix barcode
echo "[text]" | dmtxwrite -o [output.png]
Create barcode from file contents
dmtxwrite -o [output.png] < [data.txt]
Set module (cell) size in pixels
echo "[text]" | dmtxwrite -d [5] -o [output.png]
Set margin size in pixels
echo "[text]" | dmtxwrite -m [10] -o [output.png]
Create SVG output
echo "[text]" | dmtxwrite -o [output.svg]
Use specific symbol size
echo "[text]" | dmtxwrite -s s -o [output.png]
Print codeword listing instead of barcode
echo "[text]" | dmtxwrite -c
Set image print resolution (DPI)
echo "[text]" | dmtxwrite -R [300] -o [output.png]
说明
dmtxwrite generates Data Matrix barcode images from input text or binary data. Data Matrix barcodes are 2D square or rectangular patterns that encode data with built-in error correction. The tool reads data from standard input and produces images in various formats. Symbol size is automatically chosen based on data length, or can be specified manually. Error correction is automatically included per the Data Matrix standard. Data Matrix barcodes are widely used for small item marking (electronics, medical devices), logistics, and anywhere high data density is needed in a small space.
参数
- -o, --output _file_
- Output filename. Default is standard output.
- -d, --module _pixels_
- Module (cell) size in pixels.
- -m, --margin _pixels_
- Margin size in pixels.
- -s, --symbol-size _size_
- Symbol size: s(quare auto), r(ectangle auto), or RxC (e.g., 24x24).
- -e, --encoding _scheme_
- Encodation scheme: b(est), a(scii) default, c(40), t(ext), x(12), e(difact), 8 (Base 256).
- -R, --resolution _dpi_
- Image print resolution in DPI.
- -f, --format _format_
- Output format: png default, tif, gif, pdf, svg.
- -c, --codewords
- Print codeword listing instead of creating barcode image.
- -M, --mosaic
- Create non-standard Data Mosaic barcode.
- -v, --verbose
- Verbose output.
- -V, --version
- Print version information.
FAQ
What is the dmtxwrite command used for?
dmtxwrite generates Data Matrix barcode images from input text or binary data. Data Matrix barcodes are 2D square or rectangular patterns that encode data with built-in error correction. The tool reads data from standard input and produces images in various formats. Symbol size is automatically chosen based on data length, or can be specified manually. Error correction is automatically included per the Data Matrix standard. Data Matrix barcodes are widely used for small item marking (electronics, medical devices), logistics, and anywhere high data density is needed in a small space.
How do I run a basic dmtxwrite example?
Run `echo "[text]" | dmtxwrite -o [output.png]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o, --output _file_ do in dmtxwrite?
Output filename. Default is standard output.