module

RQRCode::Export::SVG

Constants

DEFAULT_SVG_ATTRIBUTES = ["version=\"1.1\"", "xmlns=\"http://www.w3.org/2000/svg\"", "xmlns:xlink=\"http://www.w3.org/1999/xlink\"", "xmlns:ev=\"http://www.w3.org/2001/xml-events\""]
SVG_PATH_COMMANDS = {:move => "M", :up => "v-", :down => "v", :left => "h-", :right => "h", :close => "z"} of Symbol => String

Instance methods

as_svg(fill : String | Symbol | Nil = nil, color : String | Symbol = "000", offset : Int32 | String | Nil = nil, module_size : Int32 = 11, shape_rendering : String = "crispEdges", standalone : Bool | Nil = nil, viewbox : Bool | Nil = nil, use_path : Bool | Nil = nil, svg_attributes : Hash(String, String) = {} of String => String)

Render the SVG from the Qrcode.

Options: offset - Padding around the QR Code in pixels (default 0) fill - Background color e.g "ffffff" (default none) color - Foreground color e.g "000" (default "000") module_size - The Pixel size of each module (defaults 11) shape_rendering - SVG Attribute: auto | optimizeSpeed | crispEdges | geometricPrecision (defaults crispEdges) standalone - Whether to make this a full SVG file, or only an svg to embed in other svg (default true) use_path - Use <path> to render SVG rather than <rect> to significantly reduce size and quality. This will become the default in future versions. (default false) viewbox - replace width and height in with a viewBox, allows CSS scaling (default false) svg_attributes - A optional hash of custom attributes. Existing attributes will remain. (default {})

Source

Nested types