A Clojure library for drawing barcodes based on gnu-barcode (using JNI) and php-barode.
lein dependency:
[batsuev/barcode "0.1.0"]
project.clj:
:jvm-opts ["-Dbarcode.so=path-to-barcode.so"]
cd barcode
./configure
make
(ns your-project
(:require [barcode.core :as barcode] ... ))
(defn- show-barcode [request]
(let [code (-> request :params (get "code"))]
(barcode/setup)
(barcode/generate code "ANY" 2 "png")))
(defroutes app-routes
(GET "/barcode" [] show-barcode))
(ns your-project
(:require [barcode.core :as barcode]
[clojure.java.io :as io]))
(barcode/setup)
(io/copy (:body (barcode/generate "123456" "ANY" 2 "png")) (io/file "test.png"))
Copyright © 2016
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
Can you improve this documentation? These fine people already did:
batsuev, Alexandr Batsuev & Aleksandr BatsuevEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close