# \[ANN\] QRCode.jl: Create QR Code within Julia

**URL:** <https://discourse.julialang.org/t/ann-qrcode-jl-create-qr-code-within-julia/26923>\
**Category:** Community\
**Tags:** package, announcement\
**Created:** [July 29, 2019, 3:46am UTC](https://discourse.julialang.org/t/ann-qrcode-jl-create-qr-code-within-julia/26923 "2019-07-29T03:46:20Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [July 29, 2019, 9:04am UTC](https://discourse.julialang.org/t/ann-qrcode-jl-create-qr-code-within-julia/26923/3 "2019-07-29T09:04:37Z")

</div>

Hey, this is great! I needed this a few weeks ago, trying the [#betterposter](https://www.insidehighered.com/news/2019/06/24/theres-movement-better-scientific-posters-are-they-really-better) thing (which recommends using a QR code to link to further information).

Making SVG or PDF is easy enough:

```julia
using Luxor, QRCode

qrc = qrcode("https:/www.julialang.org")

@svg begin
    tiles = Tiler(250, 250, size(qrc)..., margin=0)
    squares = first.(tiles)
    for x in eachindex(qrc)
        if qrc[x]
            box(squares[x], tiles.tilewidth, tiles.tileheight, :fill)
        end
    end
end 250 250 "/tmp/qrcode"

```

 ![01](https://global.discourse-cdn.com/julialang/original/3X/2/0/20999870599a87979a5edca372064d35d54ae946.png)

I like the idea of pushing the graphics until the QR code is only just readable. This just about works:

```julia
qrc = qrcode("https:/www.julialang.org")

@svg begin
    tiles = Tiler(250, 250, size(qrc)..., margin=0)
    setline(0.5)
    squares = first.(tiles)
    @layer begin
        for (n, pt) in enumerate(box(O, 140, 140, vertices=true))
            sethue([Luxor.julia_purple, Luxor.julia_blue, Luxor.julia_red, Luxor.julia_green][n])
            circle(pt, 50, :fill)
        end
    end
    for x in eachindex(qrc)
        if qrc[x]
            sethue("black")
            box(squares[x], tiles.tilewidth, tiles.tileheight, :fill)
        end
    end
end 250 250 "/tmp/qrcode"

```

 ![46](https://global.discourse-cdn.com/julialang/original/3X/a/f/afbd8b7db2f872a42f1f87c05297da86862ffc82.png)

but I’m testing it on a screen - it might not be so reliable when printed out.

Nice package!

---

_[View the full topic](https://discourse.julialang.org/t/ann-qrcode-jl-create-qr-code-within-julia/26923)._
