#!/bin/bash
# create_barcode.sh
# sudo apt-get install barcode imagemagick
CODE=$1 #the code ... first parameter
FNAME=$2 #the filename .png .... second parameter (without file extension)
# let's create postscript:
barcode -E -b "$CODE" | convert -density 600 ps:- png:- > $FNAME
# use:
#
# bash create_barcode.sh 123456789 output.png #it autodetect's the preferable encoding
#
# this creates "output.png"
#
# Security Error:
#
# if you get security error: convert not authorized (ps/png) do this:
#
# edit /etc/ImageMagick-6/policy.xml
#
# disable this:
<!--policy domain="coder" rights="none" pattern="PS" />-->
# and append this:
<policy domain="coder" rights="read/write" pattern="PNG,PS" />
This script creates a barcode from ubuntu/linux command line (perhaps other distros).
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.