Class: WirisPlugin::ImageFormatControllerSvg
- Inherits:
-
Object
- Object
- WirisPlugin::ImageFormatControllerSvg
- Extended by:
- ImageFormatControllerInterface
- Includes:
- Wiris
- Defined in:
- lib/com/wiris/plugin/impl/ImageFormatControllerSvg.rb
Instance Method Summary collapse
- #getContentType ⇒ Object
- #getMetrics(bytes, ref_output) ⇒ Object
-
#initialize ⇒ ImageFormatControllerSvg
constructor
A new instance of ImageFormatControllerSvg.
Methods included from ImageFormatControllerInterface
Constructor Details
#initialize ⇒ ImageFormatControllerSvg
10 11 12 |
# File 'lib/com/wiris/plugin/impl/ImageFormatControllerSvg.rb', line 10 def initialize() super() end |
Instance Method Details
#getContentType ⇒ Object
13 14 15 |
# File 'lib/com/wiris/plugin/impl/ImageFormatControllerSvg.rb', line 13 def getContentType() return "image/svg+xml" end |
#getMetrics(bytes, ref_output) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/com/wiris/plugin/impl/ImageFormatControllerSvg.rb', line 16 def getMetrics(bytes,ref_output) svg = bytes::toString() output = ref_output svgXml = WXmlUtils::parseXML(svg) width = svgXml::firstElement()::get("width") height = svgXml::firstElement()::get("height") baseline = svgXml::firstElement()::get("wrs:baseline") if output!=nil PropertiesTools::setProperty(output,"width",""+width) PropertiesTools::setProperty(output,"height",""+height) PropertiesTools::setProperty(output,"baseline",""+baseline) r = "" else r = (((("&cw="+width)+"&ch=")+height)+"&cb=")+baseline end return r end |