mutool barcode¶
The barcode command is used to either decode a barcode from an image or
document, or to create a new barcode image.
This command may not be available!
It is only present if MuPDF was compiled with the ZXing barcode library.
Decoding barcodes¶
mutool barcode -d [options] file1.pdf [pages1] [file2.pdf [pages2] ...]
[options]Options are as follows:
-ppasswordUse the specified password if the file is encrypted.
-ooutputThe output file name (e.g. “output.txt”). If this option is not present, any text from decoded barcodes will be printed to standard out.
-rrotationHow much to rotate the input pages in degrees (0-360), before trying to decode any barcodes.
file1andfile2, etc.Input file name. The input can be any of the supported document formats.
[pages1]andpages2, etc.Comma separated list of page ranges. The first page is “1”, and the last page is “N”. The default is “1-N”.
Encoding barcodes¶
mutool barcode -c [options] text
[options]Options are as follows:
-ooutputThe output file name. PNG or PDF format is chosen depending on the file extension. If none is given, the default is
out.png.-FformatThe desired output barcode format:
azteccodabarcode39code93code128databardatabarexpandeddatamatrixean8ean13itfmaxicodepdf417qrcodeupcaupcemicroqrcodermqrcodedxfilmedgedatabarlimited
-ssizeSet size in pixels for the output barcode. If not specified, the smallest size that can be decoded is chosen.
-qAdd quiet zones around the barcode. This puts an empty margin around created barcodes.
-tAdd human-readable text, when available. Some barcodes, e.g. EAN-13, may have the barcode contents printed in human-readable text next to the barcode, which is enabled by this flag.
-elevelSet error correction level (0-8). Some barcodes, e.g. QR-codes, support several levels of error correction, which can be customized through this option.
textThe text to be encoded into a barcode.