Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Wrapper for SVG Transcoding using Apache Batik

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 ruby-batik.gemspec


Batik ( is a Java-based toolkit for applications or applets that want to use images in the Scalable Vector Graphics (SVG) format for various purposes, such as display, generation or manipulation.

Quick Start

Be sure to add your batik installation to the classpath.


# Create a transcoder
transcoder =

# Transcode an svg string to a string as a PNG
png = transcoder.to_png(svg_document)

# Transcode an svg string to a string as a JPEG
jpeg = transcoder.to_jpeg(svg_document)

# Transcode an svg string to a string as a PNG with some options
png = transcoder.to_png(svg_document, :dpi => 600, :indexed => 8)

# Transcode an svg string to a file'new.png', 'wb+') { |fp|
Something went wrong with that request. Please try again.