Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class SvgWriter
- Object
- SvgWriter
Writes an ArtDocument as SVG.
Shapes, paths, groups, gradients, image paints, clips, masks, text and blend modes are written as SVG. Effects with an SVG filter equivalent (blurs, shadows, color matrices and SVG filter graphs) become filters. A node whose effects SVG cannot express (a bevel, a curves adjustment) and every adjustment layer is written as the image it renders to, so the output looks the same in any SVG viewer.
Constructors
public SvgWriter() |
Methods
Inherited methods
Constructor details
SvgWriter
public SvgWriter()Method details
setRasterScale
public SvgWriter setRasterScale(double scale)Sets the resolution, in pixels per unit, of nodes written as images.
Parameters
scaledouble- pixels per document unit
write
public static void write(ArtDocument doc, OutputStream out)
throws IOExceptionWrites a document.
Parameters
docArtDocument- the document
outOutputStream- receives UTF-8 SVG; not closed
Throws
toSvg
public String toSvg(ArtDocument doc)The SVG text of a document.
Parameters
docArtDocument- the document
pathData
public static String pathData(GeneralPath p)Path data for a path.
Parameters
pGeneralPath- the path