Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class SketchReader

  1. Object
  2. SketchReader

Reads Sketch files (Sketch 43 and later: a ZIP of JSON) into an ArtDocument.

Every page becomes a group under the root; the first page is visible and the document is sized to its content. Artboards become clipping frames, groups and shape groups keep their structure, symbol instances are expanded from their masters with text, image and nested symbol overrides applied, and fills, borders, shadows, inner shadows, the four blurs, blend modes, opacity, rotation, flips and clipping masks are read and rendered.

Fields

public static final int MAX_SYMBOL_DEPTH = 32The deepest symbol nesting expanded.
public static final int MAX_LAYERS = 200000The most layers read.
public static final int MAX_NESTING = 256How deep groups may nest before a file is refused.

Methods

public static ArtDocument read(InputStream in) throws IOExceptionReads a Sketch file.

Inherited methods

Field details

MAX_SYMBOL_DEPTH

public static final int MAX_SYMBOL_DEPTH = 32
The deepest symbol nesting expanded.

MAX_LAYERS

public static final int MAX_LAYERS = 200000
The most layers read.

MAX_NESTING

public static final int MAX_NESTING = 256
How deep groups may nest before a file is refused.

Method details

read

public static ArtDocument read(InputStream in) throws IOException
Reads a Sketch file.

Parameters

in InputStream
the file; read to its end, not closed