Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class SvgReader
- Object
- SvgReader
Reads SVG 1.1 and SVG 2 static documents into an ArtDocument.
Covers shapes and paths, groups, nested svg, use with symbol, switch,
presentation attributes, inline styles and <style> sheets (type, class, id and
compound selectors), gradients with href inheritance, patterns, clipPath, mask,
every filter primitive, text with tspan, image with data URLs and resolved links,
mix-blend-mode and viewBox with preserveAspectRatio. Markers are expanded into
shapes. Animation and scripts have no static meaning and are reported as notes.
Nested types
interface SvgReader.ResourceResolver | Loads what an href names. |
Constructors
public SvgReader() |
Methods
Inherited methods
Constructor details
SvgReader
public SvgReader()Method details
setResolver
public SvgReader setResolver(SvgReader.ResourceResolver resolver)Sets what loads linked images and documents; without one only data URLs are read.
Parameters
resolverSvgReader.ResourceResolver- the resolver, or null
read
public static ArtDocument read(InputStream in)
throws IOExceptionReads an SVG document.
Parameters
inInputStream- the document; not closed
Throws
read
public static ArtDocument read(byte[] data)
throws IOExceptionReads an SVG document from bytes.
Parameters
databyte[]- the document
Throws
parse
public ArtDocument parse(InputStream in)
throws IOExceptionReads an SVG document with this reader’s settings.
Parameters
inInputStream- the document; not closed
Throws
transform
public static Matrix transform(String v)Parses an SVG
transform attribute.Parameters
vString- the attribute; null gives the identity