Class: Vectory::Ps
Instance Attribute Summary
Attributes inherited from Vector
#initial_path
Attributes inherited from Image
#content
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Vector
#convert_with_inkscape, #file_size, from_datauri, from_path, #height, #initialize, #mime, #path, #size, #to_uri, #width, #write
Methods inherited from Image
from_content, from_path, #initialize
Class Method Details
.default_extension ⇒ Object
5
6
7
|
# File 'lib/vectory/ps.rb', line 5
def self.default_extension
"ps"
end
|
.from_node(node) ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'lib/vectory/ps.rb', line 13
def self.from_node(node)
return from_content(node.children.to_xml) unless node.text.strip.empty?
uri = node["src"]
return Vectory::Datauri.new(uri).to_vector if %r{^data:}.match?(uri)
from_path(uri)
end
|
.mimetype ⇒ Object
9
10
11
|
# File 'lib/vectory/ps.rb', line 9
def self.mimetype
"application/postscript"
end
|
Instance Method Details
#to_emf ⇒ Object
26
27
28
|
# File 'lib/vectory/ps.rb', line 26
def to_emf
convert_with_inkscape("--export-type=emf", Emf)
end
|
#to_eps ⇒ Object
22
23
24
|
# File 'lib/vectory/ps.rb', line 22
def to_eps
convert_with_inkscape("--export-type=eps", Eps)
end
|
#to_svg ⇒ Object
30
31
32
|
# File 'lib/vectory/ps.rb', line 30
def to_svg
convert_with_inkscape("--export-type=svg", Svg)
end
|