teamon / rsvg

Render SVG into PNG in Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RSVG

⚠️ WARNING: This is an experimental proof of concept. Read the code, use at your own risk ⚠️

Elixir library to render SVG into PNG using librsvg.

Usage

# Get some SVG (read from file, generate in memory, etc.)
svg = File.read!("example.svg")

# Render into PNG
png = RSVG.render(svg, :png)

# Write to file (or serve via phoenix/plug)
File.write!("example.png", png)

Installation

If available in Hex, the package can be installed by adding rsvg to your list of dependencies in mix.exs:

def deps do
  [
    {:rsvg, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/rsvg.

About

Render SVG into PNG in Elixir


Languages

Language:Elixir 48.5%Language:C 42.0%Language:Makefile 9.6%