# Class SVGExporter

java.lang.Object
jspecview.export.SVGExporter

All Implemented Interfaces:
  `JSVExporter`

public class SVGExporter extends Object
class `SVGExporter` contains static methods to export a Graph as as SVG. Uses a template file called 'plot.vm'. So any changes in design should be done in this file. Modified 6 Oct 2010 added lastX for Inkscape SVG export so baseline could be printed 2021.05.08 Bob Hanson fixes SVG export for HTML5

Author:
  Debbie-Ann Facey, Khari A. Bryan, Craig A.D. Walters, Prof Robert J. Lancashire

## Field Summary

Fields
Modifier and Type
Field
Description
`protected OC`
`out`
`protected JSViewer`
`vwr`

## Constructor Summary

Constructors
Constructor
Description
`SVGExporter()`

## Method Summary

Modifier and Type
Method
Description
`String`
`exportTheSpectrum(JSViewer viewer, ExportType mode, OC out, Spectrum spec, int startIndex, int endIndex, PanelData pd, boolean asBase64)`
Export a Graph as SVG to a file given by fileName
`protected void`
`initForm(JSViewer viewer, OC out)`
`protected String`
`writeForm(String templateFile)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### out

protected OC out

### vwr

protected JSViewer vwr

## Constructor Details

### SVGExporter

public SVGExporter()

## Method Details

### exportTheSpectrum

public String exportTheSpectrum(JSViewer viewer, ExportType mode, OC out, Spectrum spec, int startIndex, int endIndex, PanelData pd, boolean asBase64) throws IOException
Export a Graph as SVG to a file given by fileName

Parameters:
  `viewer` -
  `mode` - TODO
  `out` - the file path
  `spec` - the Graph
  `startIndex` -
  `endIndex` -
  `pd` - only for SVG/SVGI
  `asBase64` - TODO
Returns:
  data if fileName is null
Throws:
  `IOException`

### initForm

protected void initForm(JSViewer viewer, OC out)

### writeForm

protected String writeForm(String templateFile) throws IOException

Throws:
  `IOException`