Class Barby::SvgOutputter
In: lib/barby/outputter/svg_outputter.rb
Parent: Outputter

Renders the barcode to a simple SVG image using pure ruby

Registers the to_svg, bars_to_path, and bars_to_rects method

Bars can be rendered as a stroked path or as filled rectangles. Path generally yields smaller files, but this doesn‘t render cleanly in Firefox 3 for odd xdims. My guess is that the renderer tries to put half a pixel on one side of the path and half on the other, leading to fuzzy dithering instead of sharp, clean b&w.

Therefore, default behavior is to use a path for even xdims, and rectangles for odd. This can be overridden by calling with explicit :use => ‘rects’ or :use => ‘path’ options.

Methods

Attributes

bmargin  [W] 
height  [W] 
lmargin  [W] 
margin  [W] 
rmargin  [W] 
title  [W] 
tmargin  [W] 
xdim  [W] 
xmargin  [W] 
ydim  [W] 
ymargin  [W] 

Public Instance methods

[Validate]