Project

svg_export

0.0
No release in over 3 years
Low commit activity in last 3 years
Rails engine for rasterizing Highcharts SVG files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 5.1.0
 Project Readme

Gem Version

Svg-Export Engine for Ruby on Rails

Highcharts compliant svg-rasterizer. To find more about Highcharts Exporting, look here

Features:

  • makes relative URLs absolute (with HTTP_REFERER)
  • relative URLs that begins with /assets are locally linked (Performance boost + works in single-threaded server envs)

Installation

1. install Gem

# Gemfile
gem 'svg_export'

Run bundle

2. mount engine + configure

# config/routes.rb

Rails.application.routes.draw do
  #...

  mount SvgExport::Engine => '/exporting'
end

3. Download or install Apache Batik

This project needs Apache Batik installed on the system.

Quick install:

cd bin
wget http://ftp.halifax.rwth-aachen.de/apache/xmlgraphics/batik/binaries/batik-bin-1.8.tar.gz
tar xf batik-bin-1.8.tar.gz

And configure the path, e.g. in config/initializers/svg_export.rb

SvgExport::Engine.batik_path = Rails.root.join('bin/batik-1.8/batik-rasterizer-1.8.jar')

4. Change Highchart configuration to use that server:

e.g.:

{
  exporting: {
    url: '/exporting'
  }
}