comparison mupdf-source/docs/tools/mutool-barcode.rst @ 3:2c135c81b16c

MERGE: upstream PyMuPDF 1.26.4 with MuPDF 1.26.7
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:44:09 +0200
parents b50eed0cc0ef
children
comparison
equal deleted inserted replaced
0:6015a75abc2d 3:2c135c81b16c
1 mutool barcode
2 ==============
3
4 The ``barcode`` command is used to either decode a barcode from an image or
5 document, or to create a new barcode image.
6
7 This command may not be available!
8
9 It is only present if MuPDF was compiled with the ZXing barcode library.
10
11 Decoding barcodes
12 ~~~~~~~~~~~~~~~~~
13
14 .. code-block:: bash
15
16 mutool barcode -d [options] file1.pdf [pages1] [file2.pdf [pages2] ...]
17
18 ``[options]``
19 Options are as follows:
20
21 ``-p`` password
22 Use the specified password if the file is encrypted.
23
24 ``-o`` output
25 The output file name (e.g. "output.txt"). If this option is not
26 present, any text from decoded barcodes will be printed to
27 standard out.
28
29 ``-r`` rotation
30 How much to rotate the input pages in degrees (0-360), before trying to decode any barcodes.
31
32 ``file1`` and ``file2``, etc.
33 Input file name. The input can be any of the supported document formats.
34
35 ``[pages1]`` and ``pages2``, etc.
36 Comma separated list of page ranges. The first page is "1", and the last page is "N". The default is "1-N".
37
38 Encoding barcodes
39 ~~~~~~~~~~~~~~~~~
40
41 .. code-block:: bash
42
43 mutool barcode -c [options] text
44
45 ``[options]``
46 Options are as follows:
47
48 ``-o`` output
49 The output file name. PNG or PDF format is chosen depending on
50 the file extension. If none is given, the default is
51 ``out.png``.
52
53 ``-F`` format
54 The desired output barcode format:
55
56 - ``aztec``
57 - ``codabar``
58 - ``code39``
59 - ``code93``
60 - ``code128``
61 - ``databar``
62 - ``databarexpanded``
63 - ``datamatrix``
64 - ``ean8``
65 - ``ean13``
66 - ``itf``
67 - ``maxicode``
68 - ``pdf417``
69 - ``qrcode``
70 - ``upca``
71 - ``upce``
72 - ``microqrcode``
73 - ``rmqrcode``
74 - ``dxfilmedge``
75 - ``databarlimited``
76
77 ``-s`` size
78 Set size in pixels for the output barcode. If not specified,
79 the smallest size that can be decoded is chosen.
80
81 ``-q``
82 Add quiet zones around the barcode. This puts an empty margin
83 around created barcodes.
84
85 ``-t``
86 Add human-readable text, when available. Some barcodes, e.g.
87 EAN-13, may have the barcode contents printed in human-readable
88 text next to the barcode, which is enabled by this flag.
89
90 ``-e`` level
91 Set error correction level (0-8). Some barcodes, e.g. QR-codes,
92 support several levels of error correction, which can be
93 customized through this option.
94
95 ``text``
96 The text to be encoded into a barcode.