Liking cljdoc? Tell your friends :D

Summary

Forked version of killme2008's clj.qrgen - clojure wrapper over QRGen with iCal scheme added.

Usage

(use 'qrgen)

Create a QRCode from a text then save as a temporary file:

(as-file (from "hello world"))

Created with options:

;; override size and image type
(from "hello world" :size [250 250] :image-type JPG)
;; supply charset hint to ZXING
(from "hello world" :charset "utf-8")
;; supply error correction level hint to ZXING
(from "hello world" :correction L)
;; supply any hint to ZXING
(from "hello world" :hint {CHARACTER_SET "utf-8"})

Encode contact data as vcard using defaults:

(from (vcard "John Doe"
             :email "john.doe@example.org"
			 :address "John Doe Street 1, 5678 Doestown"
			 :title "Mister"
			 :company "John Doe Inc."
			 :phonenumber "1234"
			 :website "www.example.org"))

same with ical:

(from (ical "20170324T193000Z" ;; DTSTART
            "20170324T194000Z" ;; DTEND
            :organizer "Foo"
            :summary "Birthday party" 
            :location "Coffee Bar"
            :description "Bring sandwiches")

As InputStream( as ring response):

(as-input-stream (from "hello world"))

As OutputStream:

(as-output-stream (from "hello world"))

As byte array:

(as-bytes (from "hello world"))

Suppy own file name:

(as-file (from "hello world") "QRCode.png")

Work with clojure.java.io:

(require '[clojure.java.io :as io])
(io/file (from "hello world"))
(io/output-stream (from "hello world"))
(io/input-stream (from "hello world"))
(io/copy (io/file (from "hello world")) a-output-stream)

License

Copyright © 2014 dennis zhuang, 2019 michał buczko

Distributed under the Eclipse Public License version 1.0

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close