Module: Svg2pdf

Defined in:
lib/svg2pdf.rb

Defined Under Namespace

Classes: CairoError, Config, FileNotFoundError, InvalidSvgFileError, Processor, Svg2pdfError, UnsupportedFormatError

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



13
14
15
# File 'lib/svg2pdf.rb', line 13

def config
  @config
end

Class Method Details

.configure {|config| ... } ⇒ Object

Yields:



20
21
22
# File 'lib/svg2pdf.rb', line 20

def self.configure
  yield(config)
end

.convert_from_data(svg, format, options = {}) ⇒ Object



30
31
32
33
34
# File 'lib/svg2pdf.rb', line 30

def self.convert_from_data(svg, format, options={})
  options = config.to_hash.merge!(options)
  processor = Processor.new(svg, :from_data, format, options)
  processor.process
end

.convert_from_file(svg, format, options = {}) ⇒ Object



24
25
26
27
28
# File 'lib/svg2pdf.rb', line 24

def self.convert_from_file(svg, format, options={})
  options = config.to_hash.merge!(options)
  processor = Processor.new(svg, :from_file, format, options)
  processor.process
end