Module barcoders::generators::svg

source ·
Expand description

Functionality for generating SVG representations of barcodes.

An SVG can be constructed via the standard constructor pattern or via a constructor method if you want default values.

For example:

use barcoders::generators::svg::*;

// Specify your own struct fields.
let svg = SVG{height: 80,
              xdim: 1,
              background: Color{rgba: [255, 0, 0, 255]},
              foreground: Color::black(),
              xmlns: Some(String::from("http://www.w3.org/2000/svg"))};

// Or use the constructor for defaults (you must specify the height).
let svg = SVG::new(100)
              .xdim(2)
              .background(Color::white())
              .foreground(Color::black())
              .xmlns(String::from("http://www.w3.org/2000/svg"));

Structs§

  • Represents a RGBA color for the barcode foreground and background.
  • The SVG barcode generator type.