JIIX format reference

Reference of the JSON Interactive Ink eXchange format (JIIX) version 3.

Content

JIIX is an exchange format to export, share and re-import the internal semantics of the Interactive Ink model.

As such, it is designed to host information about:

  • Content - strokes, glyphs and graphical primitives
  • Semantic interpretation of the content, including lists
  • Style information - decorations, color, width, font, etc.

When exporting JIIX from iink SDK, depending on the use case, you may sometimes want to only retrieve part of this information. This is managed at configuration level, via the following keys:

  • export.jiix.bounding-box - Export item bounding boxes
  • export.jiix.strokes - Export ink strokes
  • export.jiix.glyphs - Export converted glyphs
  • export.jiix.primitives - Export shape primitives (lines, circles, etc.)
  • export.jiix.style - Export detailed styling information (color, width, font, etc.)
  • export.jiix.text.chars - Export detailed information about the characters in the text interpretation
  • export.jiix.text.words - Export detailed information about the words in the text interpretation
  • export.jiix.ids - Export items ids.
  • export.jiix.deprecated.text.linebreaks - Export detailed information about the line breaks within a text.
  • export.jiix.text.structure - Export detailed information about the text layout structure for Text blocks.
  • export.jiix.ranges - Export ink strokes ranges when using a Raw Content Recognizer.
  • export.jiix.shape.candidates - Export shape candidates when using a Shape Recognizer.

For more information about these parameters, including default values, refer to the configuration reference.

Versioning

The version of the format that the current document conforms to is given by the version property of the root of the JSON document (as the root of the document corresponds to the root block of the exposed content block hierarchy, the version property belongs to this root block).

DescriptionContentNote
Version of the JIIX formatA string identifying the current iteration of the formatThis property was added with iink SDK 1.3. JIIX documents before 1.3 do not have this property

For example, if the root block is a "Text" block, we will have something like:

{
 "version": "3",
 "type": "Text",
 "bounding-box": { ... },
 "label": "Hello world!",
 "words": [ ... ],
 "id": "MainBlock"
}

Unit system

Units are not explicitly provided in a JIIX document.

For system coordinates, they shall be understood as model units, that is to say millimeters. The actual rendering of a JIIX document on the screen will then depend on the dpi and any other parameter (zoom, offset) used to configure the renderer.

The angles are specified in radians.

Structure

Block hierarchy

JIIX documents are organized as a hierarchy of JSON objects (called "Blocks" in this page) that mirrors the block hierarchy of a content part. Each object has a specific type string property identifying it as a text block, a diagram block, a math node, etc. and defining the block semantics.

For example, a simple diagram may aggregate a text label and a rectangular node:

{
 "type": "Diagram",
 "elements": [ {
   "type": "Text",
   ...
  }, {
   "type": "Node",
   "kind": "rectangle",
   ...
  } ],
 ...
}

This semantics, in turn defines how sub-blocks are aggregated. For example :

  • A Diagram block will host an array of "Diagram Item" blocks under its elements property.
  • A Math block will host an array of "Math Node" blocks under its expressions property.
  • A generic Container block will host its sub-blocks under a children property.
  • ...
To know the precise semantics of a given type of block, please refer to its detailed description below.

Properties common to blocks

Whatever their types, all blocks share the following common properties:

PropertyDescriptionContentNote
idBlock unique reference in the context of the documentA string
bounding-boxExtent of the blockx, y, width, height - 4 numerical values defining a rectangle which upper-left corner is positioned at coordinates (x, y) and of size (width, height)Present in the JIIX export when export.jiix.bounding-box configuration is true

For example, a simple text block can be represented as:

{
 "type": "Text",
 "id": "MainBlock",
 "bounding-box": {
  "x": 20.43125,
  "y": 31.272942,
  "width": 9.9375,
  "height": 8.9725456
 },
 ...
}

Other potential properties depend on the type of the block. Refer to the "blocks" section for more details.

Block content description

Block content is described using items, which represent what is actually visible when rendering the model.

Items

Items are used to describe the content of blocks in terms of ink, glyphs or shape primitives.

Like blocks, items share common properties:

PropertyDescriptionContent
typeType of the itemstroke, line, arc or glyph
idItem unique reference in the context of the document.A string

Stroke item

A stroke item represents a standalone portion of ink, that is to say the trajectory of a writing tool between a pointer down and the corresponding pointer up.

It has the following specific properties:

PropertyDescriptionContent
timestampPrecise date and time of the pointer downExample: "2018-11-28 09:31:43.893000"
XX coordinates of the different points of the stroke, ordered from pointer down to pointer upAn array of numbers
YY coordinates of the different points of the stroke, ordered from pointer down to pointer upAn array of numbers.
FForce (a.k.a pressure) of the different points of the stroke, ordered from pointer down to pointer upAn array of numbers
TTime offset of the different points of the stroke in ms relatively to the timestamp of the stroke, ordered from pointer down to pointer upAn array of numbers

Example:

{
  "timestamp": "2021-08-31 15:14:39.652000",
  "X": [ 58.5874977, 58.7666626, 58.7666626, 58.7666626, 58.7666626, 58.7666626, 58.9458313, 58.9458313,
  59.1249962, 59.4833298, 59.8416634, 60.0208321, 60.0208321, 60.0208321, 60.0208321, 60.0208321,
  60.1999969, 60.1999969, 60.3791618, 60.5583305, 60.5583305 ],
  "Y": [ 33.2518494, 33.2518494, 33.5907364, 34.1296272, 34.8481445, 35.5666618, 36.6444397, 37.5425873,
  39.159256, 40.7759209, 42.433329, 43.4703674, 44.7277718, 46.3444405, 47.4222183, 48.6796265,
  49.9370308, 50.4759216, 51.0148087, 51.0148087, 51.0148087 ],
  "F": [ 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0 ],
  "T": [ 0, 14, 30, 38, 46, 54, 62, 70,
  78, 86, 94, 102, 110, 118, 126, 134,
  142, 150, 158, 166, 206 ],
  "type": "stroke",
  "id": "0000010001002900ff00"
}
The number of elements in X, Y, T and F must be strictly identical.

Line item

A line item represents a converted line primitive, for instance the edge of a polygon.

It has the following specific properties:

PropertyDescriptionContent
timestampTimestamp of the stroke that was converted into this primitive.Example: "2018-11-29 10:03:05.980000".
x1X coordinate of the first point defining the lineA number
y1Y coordinate of the first point defining the lineA number
x2X coordinate of the second point defining the lineA number
y2Y coordinate of the second point defining the lineA number
startDecorationDecoration of a "line" start pointarrow-head in case an arrow head is present, none when no decoration
endDecorationDecoration of a "line" end pointarrow-head in case an arrow head is present, none when no decoration

Example:

{
  "type": "line",
  "timestamp": "2021-09-07 09:04:39.162000",
  "x1": 24.8770332,
  "y1": 19.7303886,
  "x2": 66.5452576,
  "y2": 19.7303886,
  "startDecoration": "none",
  "endDecoration": "none",
  "id": "0000010001000300ff00"
  }

Arc item

An arc item represents a converted arc primitive, for instance a curved connector in a diagram or a portion of an ellipse.

It has the following specific properties:

PropertyDescriptionContent
timestampTimestamp of the stroke that was converted into this primitive.Example: "2018-11-29 10:03:05.980000"
cxX coordinate of the arc centerA number
cyY coordinate of the arc centerA number
rxx-axis or semi-major radiusA number (must be positive)
ryy-axis or semi-minor radiusA number (must be positive)
phix-axis rotation angleA number
startAngleStart angle (prior to stretch and rotate)A number
sweepAngleSweep angle (prior to stretch and rotate)A number
startDecorationDecoration of an "arc" item start pointarrow-head in case an arrow head is present, none when no decoration
endDecorationDecoration of an "arc" item end pointarrow-head in case an arrow head is present, none when no decoration

Example:

{
  "type": "arc",
  "timestamp": "2021-09-06 13:56:41.110000",
  "cx": 167.432373,
  "cy": 105.229813,
  "rx": 30.8068428,
  "ry": 7.45266199,
  "phi": 0,
  "startAngle": 0,
  "sweepAngle": 6.28318548,
  "startDecoration": "none",
  "endDecoration": "none",
  "id": "0000300001008900ff00"
  }

Glyph item

A glyph item represents a converted typeset character.

It has the following specific properties:

PropertyDescriptionContentNote
timestampTimestamp of the stroke that was converted into this glyphExample: "2018-11-28 13:37:03.514000"
labelCharacter represented by the glyphExample: "B"
baselineBaseline positionA numberOptional (not used for the glyphs present in a math context)
x-heightx heightA numberOptional (not used for the glyphs present in a math context)
square-root-ratioHorizontal ratio between the size of the glyph and the "V" shape part of the square rootA numberOnly for square roots
left-side-bearingGlyph left side bearingA number
right-side-bearingGlyph right side bearingA number

Example:

{
  "type": "glyph",
  "timestamp": "2021-09-06 13:55:37.298000",
  "label": "2",
  "bounding-box": {
  "x": 39.1022644,
  "y": 27.6022339,
  "width": 1.92954254,
  "height": 3.29965172
  }

Text interpretation

Text interpreted by iink SDK is represented by word and character objects as part of a Text block.

Word object

A word object represents the recognition of a word made by the MyScript engine. Note that to get such interpretation in JIIX export, your need to set the export.jiix.text.words configuration option to true.

It has the following properties:

PropertyDescriptionContentNote
labelTop recognition result associated with this wordA string
reflow-labelReflow behavior when the word is a linefeed (i.e. with a label = \n)Possible values are "" (empty) and " " (one space) depending on whether a space should be inserted when removing this linefeed for reflow.
candidatesList of recognition candidates associated with this wordAn array of strings
bounding-boxExtent of the word.x, y, width, height - 4 numerical values defining a rectangle which upper-left corner is positioned at coordinates (x, y) and of size (width, height).Present in the JIIX export when export.jiix.bounding-box configuration is true.
itemsInk and/or glyphs composing the word.An array of stroke and/or glyph itemsStrokes only present in JIIX export when export.jiix.strokes is configured to true, glyphs only present when export.jiix.glyphs is configured to true
first-charIndex of the first character contained in this word.An integer, representing the index of a character object in the Text block.Only present in the JIIX export when export.jiix.text.chars or export.jiix.style are configured to true
last-charIndex of the last character contained in this word.An integer, representing the index of a character object in the Text blockOnly present in the JIIX export when export.jiix.text.chars or export.jiix.style are configured to true

Examples:

  • Example corresponding to the word hello:
{
  "label": "hello",
  "candidates": [ "hello", "hells", "hellor", "helle", "kello" ],
  "first-char": 0,
  "last-char": 4,
  "bounding-box": {... },
  "items": [ ... ]
}
  • Linefeed example, corresponding to the word \n:
{
   "label": "\n",
   "reflow-label": " "
}

Character object

A character object represents the recognition of a character made by the MyScript engine. Note that to get such interpretation in JIIX export, your need to set the export.jiix.text.chars configuration option to true.

It has the following properties:

PropertyDescriptionContentNote
labelRecognition result associated with this charA string
candidatesList of recognition candidates associated with this characterAn array of strings
gridHighlight area associated with this charAn array of 4 points, each containing x and y floating points coordinates
bounding-boxExtent of the characterx, y, width, height - 4 numerical values defining a rectangle which upper-left corner is positioned at coordinates (x, y) and of size (width, height)Present in the JIIX export when export.jiix.bounding-box configuration is true
itemsInk and/or glyphs composing the characterAn array of stroke and/or glyph itemsStrokes are only present in JIIX export when export.jiix.strokes is configured to true, glyphs are only present when export.jiix.glyphs is configured to true
wordIndex of the word that contains this charAn integeronly present in the JIIX export when export.jiix.text.words is configuredto true

Example:

{
  "label": "h",
  "candidates": [ "h", "k", "b", "H" ],
  "word": 0,
  "grid": [ {
    "x": 18.875834,
    "y": 31.736748
   }, {
    "x": 25.118258,
    "y": 31.736748
   }, {
    "x": 25.118258,
    "y": 44.957951
   }, {
    "x": 18.875834,
    "y": 44.957951
   } ],
  "bounding-box": { ... },
  "items": [ ... ]
 }

Style

The JIIX format can contain styling information. These encompass:

  • CSS properties that you explicitly assign to the pen (dynamic styles)
  • Style classes that you assign to the pen (pen style classes)
  • Classes and styles automatically set by iink SDK when decorations are detected.
Themes, that are local to your editor, will not be exported.

If you are exporting content, you need to set the export.jiix.style configuration key to true to get style information.

Item span styling

Blocks like Drawing and text/non-text raw content items can be seen as an ordered collection of strokes. Such a collection can be styled via the definition of "item spans", each span associating a specific style to a range of items.

Item spans have the following properties:

PropertyDescriptionContent
first-itemIndex of the first item in the spanA number (positive or null)
last-itemIndex of the last item in the spanA number (positive or null)
className of the CSS class attached to the items in the spanA string
styleInline CSS style that "overrides" any default styleA string

For example, if we write 2 strokes with pen style class set to "greenThickPen" then 2 more strokes with no pen style class but pen style set to "color : #FF324233", we obtain something like:

{
  "first-item": 0,
  "last-item": 1,
  "class": "greenThickPen"
}

and

{
 "first-item": 2,
 "last-item": 3,
 "style": "color: #FF324233"
}

Note that an item may be contain both class and style indications, or none of them if default styling applies.

Text span styling

Text blocks can be seen as an ordered collection of characters. Such a collection can be styled via the definition of "character spans", each span associating a specific style to a range of characters.

Item spans have the following properties:

PropertyDescriptionContent
first-charIndex in the text of the first character in the spanA number (positive or null)
last-charIndex in the text of the last character in the spanA number (positive or null)
className of the CSS class attached to the characters in the spanA string
styleInline CSS style that "overrides" any default styleA string

For example, text underlined by a gesture may get the following style:

{
 "first-char": 0,
 "last-char": 12,
 "class": "text-emphasis1",
 "style": "color: #000000FF; -myscript-text-decoration-color: #000000FF; -myscript-text-decoration-background-color: #FFED2666"
}

Nodes styling

Blocks like math and diagram nodes, as well as diagram connectors are independently styled.

They can directly have the following properties:

PropertyDescriptionContent
className of the CSS class attached to the nodeA string
styleInline CSS style that "overrides" any default style for the nodeA string

For example, a math node can be styled as follows:

{
 "type": "number",
 "id": "math/170",
 "label": "3",
 "value": 3,
 "items": [ ... ],
 "bounding-box": { ... },
 "class": "greenThickPen"
}

Blocks

This section lists all available blocks of the hierarchy, their properties and particularities, if any.

Container block

A block of type Container groups children blocks together.

It has the following specific property:

PropertyDescriptionContent
childrenList of blocks within this container blockAn array of blocks

For example, in the JIIX export of a "Text Document" part composed of two paragraphs of text, each paragraph will correspond to a text block and both will be grouped as the children of a same container block:

{
 "type": "Container",
 "id": "MainBlock",
 "bounding-box": { ... },
 "children": [ {
   "type": "Text",
   ...
  }, {
   "type": "Text",
   ...
  } ],
 ...
}
No assumption is made about the type of children blocks.

Diagram block

A block of type Diagram groups together the different internal blocks of an individual diagram.

It has the following specific property:

PropertyDescriptionContent
elementsArray of recognized diagram items.An array of Diagram item blocks

For example, a diagram may be composed of a Text label and of a diagram Node corresponding to a rectangle:

{
 "type": "Diagram",
 "id": "4",
 "bounding-box": { ... },
 "elements": [ {
   "type": "Text",
   ...
  }, {
   "type": "Node",
   "kind": "rectangle",
   ...
  } ],
 ...
}

Diagram item blocks

Diagram item blocks collectively form a family of blocks of different types describing the semantic structure of a diagram: connectors, text blocks, geometric shapes, etc. There is no actual "Diagram Item" type.

These blocks share the following common properties:

PropertyDescriptionContentNote
typeDiagram item typeNode, Edge, Polyedge or Text
parentDiagram item parent item (if any)A diagram item numerical id
itemsInk and/or converted shape primitives composing the itemAn array of stroke, line and/or arc itemsStrokes are only present in JIIX export when export.jiix.strokes is configured to true, lines and arcs are only present when export.jiix.primitives is configured to true

Diagram nodes and connectors (i.e. with type node, edge or polyedge) will get the following styling properties:

PropertyDescriptionContent
className of the CSS class attached to the nodeA string
styleInline CSS style that "overrides" any default style for the nodeA string

Style is only present in then JIIX export when export.jiix.style is configured to true.

Example:

{
 "id": "diagram/3/242",
 "type": "Node",
 "parent": 12,
 "bounding-box": { ... },
 "items": [ ... ],
 ... specific properties ...
}
Although diagram item blocks have an id property like other blocks, their identifier is a number with a prefix identifying their parents and not a string.

➤ Diagram Node block

A diagram item of type Node is associated with a particular shape, an optional label, and may host child items. This is modeled by the following properties:

PropertyDescriptionContent
kindDiagram item Sub-type.rectangle, rhombus, polygon, circle, ellipse or doodle
label-elementid of the diagram item of type Text that describes the label associated with the item.A diagram item numerical id
childrenArray of child diagram items associated with the itemAn array of diagram items numerical ids

Depending on its "kind", the item will have specific properties:

  • If "kind": "rectangle"
    • x - X coordinate of the upper-left corner of the rectangle.
    • y - X coordinate of the upper-left corner of the rectangle.
    • width - Width of the rectangle.
    • height - Height of the rectangle.
    • orientation - x-axis rotation angle of the selection box of the rectangle (when shape rotation is active).
  • If "kind": "rhombus"
    • points - Array containing the 4 {x, y} points describing the rhombus.
    • orientation - x-axis rotation angle of the selection box of the rhombus (when shape rotation is active).
  • If "kind": "polygon"
    • points - Array of {x, y} points describing the polygon.
    • orientation - x-axis rotation angle of the selection box of the polygon (when shape rotation is active).
  • If "kind": "circle"
    • cx - X coordinate of the circle center.
    • cy - Y coordinate of the circle center.
    • r - Radius of the circle.
    • orientation - x-axis rotation angle of the selection box of the circle (when shape rotation is active).
  • If "kind": "ellipse" : an axis aligned ellipse.
    • cx - X coordinate of the ellipse center.
    • cy - Y coordinate of the ellipse center.
    • rx - X radius of the ellipse.
    • ry - Y radius of the ellipse.
    • orientation - x-axis rotation angle of the selection box of the ellipse (when shape rotation is active).
  • If "kind": "doodle"
    • No specific property describes a doodle.
    • Note: As doodles are not converted, items will never contain shape primitives.

For example, the following node represents a rectangle in a diagram, associated with a text label:

   "type": "Node",
   "kind": "rectangle",
   "orientation": -0.0148907145,
   "label-element": "diagram/22",
   "children": [ "diagram/22" ],
   "id": "diagram/13",
   "bounding-box": {
    "x": 61.7742119,
    "y": 51.8420029,
    "width": 82.0821991,
    "height": 36.4551468
   }

➤ Diagram Edge block

A diagram item of type Edge connects other diagram items.

PropertyDescriptionContentNote
kindConnector sub-typeline or arc
childrenArray of children diagram items associated with the itemAn array of diagram items numerical ids
connectedList of the diagram items connected to this edgeAn array of diagram items numerical ids
portsList of the relative hooking positions of the diagram items connected to this edge.A list of numbers between 0 and 1.
p1DecorationDecoration of a "line" edge first pointarrow-head in case an arrow head is presentThis property is absent if there is no decoration and only applies to "line" edges
p2DecorationDecorationof a "line" edge second pointarrow-head in case an arrow head is presentThis property is absent if there is no decoration and only applies to "line" edges
startDecorationDecoration of an "arc" edge start pointarrow-head in case an arrow head is presentThis property is absent if there is no decoration and only applies to "arc" edges
endDecorationDecoration of an "arc" edge end pointarrow-head in case an arrow head is presentThis property is absent if there is no decoration and only applies to "arc" edges

Example of a "straight" edge:

{
  "type": "Edge",
  "kind": "line",
  "connected": [ "diagram/12", "diagram/47" ],
  "ports": [ 0, 0.521515965 ],
  "id": "diagram/85",
  "bounding-box": {... },
  "x1": 81.9797897,
  "y1": 49.3274384,
  "x2": 146.199982,
  "y2": 55.2804871,
  "p2Decoration": "arrow-head"
}

Note that as a "line" connector, the edge includes x1, y1, x2 and y2 properties, defined the exact same way than in the case of line items.

Example of a "curved" edge:

{
  "type": "Edge",
  "kind": "arc",
  "connected": [ "diagram/10", "diagram/53" ],
  "ports": [ 0, 1 ],
  "id": "diagram/105",
  "bounding-box": { ... },
  "items": [ ...  ],
  "cx": 120.779442,
  "cy": 74.4197159,
  "rx": 32.6964035,
  "ry": 32.6964035,
  "phi": 0.00504867753,
  "startAngle": -1.82163024,
  "sweepAngle": 3.53351736,
  "endDecoration": "arrow-head"
  }

Note that as an "arc" connector, the edge includes cx, cy, rx, ry, phi, startAngle and sweepAngle properties, defined the exact same way than in the case of arc items.

➤ Diagram Polyedge block

A diagram item of type Polyedge connects other diagram items via several other edges. It is associated with the following properties:

PropertyDescriptionContent
connectedList of the diagram items connected by this polyedgeAn array of diagram items numerical ids.
edgesList of edges composing this polyedgeA list of diagram edge items

Example of a polyedge gathering three edges together:

{
 "type": "Edge",
 "kind": "polyedge",
 "id": "diagram/65",
 "connected": [ "diagram/37" ],
 "edges": [ {
   "type": "Edge",
   "kind": "line",
   ...
  }, {
   "type": "Edge",
   "kind": "line",
   ...
  }, {
   "type": "Edge",
   "kind": "line",
   ...
  } ]
}

➤ Diagram Text block

A diagram item of type Text combines the properties of a diagram item and those of a Text Block. It is styled using text spans.

Drawing block

A drawing block gathers raw digital ink.

It can have the following specific properties:

PropertyDescriptionContentNote
itemsInk composing the block.An array of strokes itemsStrokes are present in JIIX export when export.jiix.strokes is configured to true
spansList of item spans providing styling informationAn array of item span objectsStyle is only present in then JIIX export when export.jiix.style is configured to true
imageImage data when an image is added into a Text DocumentAn image object

Example:

{
 "type": "Drawing",
 "id": "7",
 "bounding-box": { ... },
 "items": [ ... ],
 "spans": [ ... ],
 "image": { ... }
}

   "image": {
    "url": "1630419125093723_20160701_212430.jpg",
    "mime-type": "image/jpeg",
    "x": 14.0750961,
    "y": 52.8047333,
    "width": 195.449829,
    "height": 109.940521
   }

Math block

A block of type Math is associated with the following property:

PropertyDescriptionContent
expressionsArray of recognized Math expressions.An array of math node blocks.
{
 "type": "Math",
 "id": "4",
 "bounding-box": { ... },
 "expressions": [ ... ]
}

Math Node block

A math node block describes a portion of a mathematical expression. Depending on the math node type, a math node may contain other math nodes, in the operands property.

PropertyDescriptionContentNote
typeNode typeA stringExample: +, -, number, square root, see complete list
labelLabel associated with the node, when it is different from typeA stringExample: 2.453..., √, θ, dx...
operandsOperands associated with the nodes, if any.An array of math nodes
generatedSignals that the node was added by the iink engineA booleanWhen not present this property is considered false
valueNumerical value associated to a given nodeA numberNot present when the iink SDK solver could not solve this particular node
exact valueMore accurate value associated to a given nodeA numberOnly present when a value is present and whenever relevant. Example for √2, "value": 2.41421356 and "exact-value": "2.414213562373095" are present, whereas for √4, only "value": 2 is present.
itemsInk and/or glyphs composing the nodeAn array of stroke and/or glyph itemsStrokes are only present in JIIX export when export.jiix.strokes is configured to true, glyphs are only present when export.jiix.glyphs is configured to true
errorSignals that the solver detected an errorA stringPossible values are: DivisionByZeroImpossible, IncompleteInput, Unsolved, InvalidInput and FailureToObtainAValidResult
className of the CSS class attached to the nodeA stringStyle is only present in then JIIX export when export.jiix.style is configured to true
styleInline CSS style that "overrides" any default style for the nodeA stringStyle is only present in then JIIX export when export.jiix.style is configured to true

Example:

{
 "type": "+",
 "id": "math/34",
 "items": [ ... ],
 "bounding-box": { ... },
 "operands": [ ... ]
}

➤ Fence Math block

Math nodes of type fence have the following specific properties:

PropertyDescriptionContentExamples
open symbolOpening symbol of the fence. If this property is not set, indicates that no opening symbol was recognizedA string(, [, {
close symbolClosing symbol of the fence. If this property is not set, indicates that no closing symbol was recognizedA string), ], }

➤ Matrix Math block

Math nodes of type matrix have the following specific properties:

PropertyDescriptionContent
rowsMatrix content, row per rowAn array of cells objects, each representing a row of the matrix
cellsContent of a row of the matrixAn array of math nodes

➤ System Math block

Math nodes of type system have the following specific property:

PropertyDescriptionContent
expressionsArray of expressions within the systemAn array of math nodes

Text Block

A block of type Text has the following specific properties:

PropertyDescriptionContentNote
labelRecognition result associated with this text blockA stringExample: "label": "Hello how are you?"
wordsList of recognized wordsAn array of word objectsWords are only present in then JIIX export when export.jiix.text.words is configured to true
charsList of recognized charactersAn array of character objectsCharacters are only present in then JIIX export when export.jiix.text.chars is configured to true
spansList of text spans providing styling informationAn array of text span objectsStyle is only present in then JIIX export when export.jiix.style is configured to true
linebreaksList of explicit line breaks in the text blockAn array of line indexOnly present in then JIIX export when export.jiix.deprecated.text.linebreaks is configured to true
structureText layout structureA structure object that is an array of text, list and divider items.Only present in then JIIX export when export.jiix.text.structure is configured to true
Although the export.jiix.deprecated.text.linebreaks option is still available, it is deprecated. So, we recommend you using the export.jiix.text.structure option to retrieve information about line breaks.

Example:

{
 "type": "Text",
 "id": "7",
 "bounding-box": { ... },
 "label": "hello",
 "words": [ ... ],
 "chars": [ ... ],
 "spans": [ ... ]
}

MyScript iink SDK differentiates explicit from implicit line breaks. An explicit line break is detected each time the writer goes back to the beginning of the next line but there was space to insert the word at the end of the previous line. An explicit line break is for instance preserved by reflow operations. An implicit line break corresponds to the case the user went to a new line after the previous one was fully filled (based on the view size).

➤Text line breaks

Let's assume that we write something that visually looks like:

Hello
there!
This is a bit more than a full
line

configured to true will look like:

{
 "type": "Text",
 "bounding-box": { ... },
 "label": "Hello\nthere!\nThis iis a bit more than a full\nline",
 "words": [ ... ],
 "linebreaks": [ {
   "line": 0
  }, {
   "line": 1
  } ],
 "version": "3",
 "id": "MainBlock"
}

Notice the three line breaks in the main label. Via the linebreaks property, the JIIX format explicits that the line breaks on line 0 and 1 (the first two lines) are explicit line breaks.

Hello
-   How are you?
    1.   Fine
    2.   Good
         A.   Super
         B.   Extra
-   Hello
    How are you?
        How are you? How are
        you?

The corresponding JIIX file including the structure block would look like this file.

text-structure-export.jiix
{
  "type": "Text",
  "bounding-box": {
    "x": 14.2874069,
    "y": 13.3670235,
    "width": 93.5783463,
    "height": 76.583847
  },
  "label": "Hello\n- How are you?\n1. Fine\n2. Good\nA. super\nB. Extra\n- Hello\nHow are you?\nHow are you? How are you?",
  "words": [
    {
      "label": "Hello",
      "candidates": [
        "Hello",
        "Helo",
        "Heto",
        "Heer",
        "Hellor"
      ],
      "first-char": 0,
      "last-char": 4,
      "bounding-box": {
        "x": 14.2874069,
        "y": 13.3670235,
        "width": 14.5976562,
        "height": 6.3223381
      },
      "items": [
        {
          "type": "glyph",
          "timestamp": "2021-09-15 12:31:52.536000",
          "label": "H",
          "bounding-box": {
            "x": 15.2874069,
            "y": 14.5971737,
            "width": 3.01783752,
            "height": 4.02482605
          },
          "baseline": 1,
          "x-height": 0.714086533,
          "left-side-bearing": -0.174397036,
          "right-side-bearing": 1.19109464,
          "id": "0000ec0001000700ff00"
        },
        {
          "type": "glyph",
          "timestamp": "2021-09-15 12:31:54.425000",
          "label": "e",
          "bounding-box": {
            "x": 19.1506882,
// Open the file to see the full content (9,375 lines)

Raw Content block

here

A Raw Content block corresponds to the output of raw digital ink analysis. It is meant to express a segmentation between ink corresponding to text vs. ink corresponding to non-text, with optional interpretation as text and shape recognition results expressed as a hierarchy of diagram items.

A block of type Raw Content has the following specific property:

PropertyDescriptionContent
elementsArray of recognized (Diagram, Text and/or Math) items and non recognized Raw Content items, depending on raw-content.recognition.types valuesAn array of Diagram item blocks, Math item blocks, Text item blocks and Raw Content item blocks

Example:

{
 "type": "Raw Content",
 "bounding-box": { ... },
 "elements": [ {
   "type": "Node",
   "kind": "rectangle", ...
  }, {
   "type": "Text",
   "label": "hello", ...
  }, {
   "type": "Math",
   "expressions": ...
  }, {
   "type": "Raw Content",
   "kind": "non-text", ...
  } ],
 "id": "MainBlock",
 "version": "3"
}

Raw Content item block

In addition to common block properties, raw content item blocks also have the following specific properties:

PropertyDescriptionContentNote
kindRaw content item identified as representing "text" or "non-text" ink datatext or non-text
itemsItems composing the block.An array of itemsStrokes are present in JIIX export when export.jiix.strokes is configured to true

Example:

{
 "type": "Raw Content",
 "kind": "text",
 "id": "raw-content/13",
 "bounding-box": { ... },
 "items": [ ... ]
}
Although raw content item blocks have an id property like other blocks, their identifier is a number with a prefix identifying their parents and not a string.

Styling of a raw content item block is similar to Drawing for text and non-text blocks without the recognition enabled, otherwise it is similar as that of Diagram item blocks.

When adding an image into a RawContent, an image element is added that contains the following specific properties:

PropertyDescriptionContent
image-idUnique identifier of the imageA String.
urlurl of the image.The image filename (as stored into the package zip file).
mime-typemime-type of the image.Possible values are: image/jpeg, image/png and image/gif.
xX coordinate of the upper-left corner of the image.A number.
yY coordinate of the upper-left corner of the image.A number.
widthWidth of the image.A number.
heightHeight of the image.A number.
orientationx-axis rotation angle of the image (when image rotation is active).A number.

Example:

{
   "type": "Image",
   "kind": "non-text",
   "orientation": -0.458628416,
   "id": "raw-content/37",
   "bounding-box": {
    "x": 195.51796,
    "y": 23.953661,
    "width": 92.950943,
    "height": 112.844849
   },
   "image-id": "ImageId1697636709366167",
   "url": "ImageId1697636709366167.png",
   "mime-type": "image/png",
   "x": 231.879929,
   "y": 24.953661,
   "width": 59.8457947,
   "height": 95.468277,
  }

When adding a placeholder into a RawContent, a Placeholder element is added that contains the following specific properties:

PropertyDescriptionContent
image-idUnique identifier of the imageA String.
urlurl of the image.The image filename (as stored into the package zip file).
user-dataUser defined metadataA String.
mime-typemime-type of the image.Possible values are: image/jpeg, image/png and image/gif.
xX coordinate of the upper-left corner of the image.A number.
yY coordinate of the upper-left corner of the image.A number.
widthWidth of the image.A number.
heightHeight of the image.A number.

Example:

{
   "type": "Placeholder",
   "kind": "non-text",
   "id": "raw-content/37",
   "bounding-box": {
    "x": 77.3406219,
    "y": -12.4064779,
    "width": 71.203125,
    "height": 10.3078699
   },
   "image-id": "ImageId17248359471570692",
   "url": "ImageId17248359471570692.png",
   "mime-type": "image/png",
   "user-data": "User provided this string",
   "x": 78.3406219,
   "y": -11.4064779,
   "width": 69.203125,
   "height": 8.30786991
  }

Math node complete overview

typeoperandsother properties
number0label
symbol0label
group>=2
+>=1
->=1
× (U+00D7: multiplication sign)>=1
/>=1
÷ (U+00F7: division sign)>=1
fraction2
power1
!1
percentage2 (reference, percentage)operator:+, - or × (U+00D7: multiplication sign)
=2
>2
<2
≈ (U+2248: almostEqualTo)2
≃ (U+2243: asymptoticallyEqualTo)2
≠ (U+2260: notEqualTo)2
≡ (U+2261: identicalTo)2
≢ (U+2262: notIdenticalTo)2
≤ (U+2264: lessThanOrEqualTo)2
≥ (U+2265: greaterThanOrEqualTo)2
≪ (U+226A: muchLessThan)2
≫ (U+226B: muchGreaterThan)2
⇐ (U+21D0: leftwardsDoubleArrow)2
⇒ (U+21D2: rightwardsDoubleArrow)2
⇔ (U+21D4: leftRightDoubleArrow)2
∥ (U+2225: parallelTo)2
square root1√ (U+221A: square root)
system0expressions[node]
matrix0rows[cells]
rows0cells[node]
fence1open symbol, close symbol
underscript2 (script, underscript)
overscript2 (script, overscript)
underoverscript3 (script, underscript, overscript)
superscript2 (script, superscript)
subscript2 (script, subscript)
subsuperscript3 (script, subscript, superscript)
presuperscript2 (script, presuperscript)
partialfractionnumerator1 (numerator)
partialfractiondenominator1 (denominator)
slantedfraction2 (numerator, denominator)
mixed2 (fraction, number)

Recognizer blocks

Gesture block

A Gesture block corresponds to the output of Gesture Recognizer analysis.

In addition to common block properties, a Gesture block also has the following specific property:

PropertyDescriptionContent
gesturesArray of gesture itemsAn array of gesture items

Example:

{
  "version": "3",
  "type": "Gesture",
  "gestures": [ ... ]
}

gesture item block

In addition to common block properties, gestures item blocks also have the following specific properties:

PropertyDescriptionContentNote
typeGesture item identified as representing ink or touch gestureA stringPossible values are none, bottom-top, top-bottom, right-left, left-right, scratch, surround, tap, double-tap and long-press.

Example:

"gestures": [ {
  "type": "surround",
  "strokes": [ {
    "id": "ps6",
    "bounding-box": {
     "x": 13.5319223,
     "y": 33.2388916,
     "width": 24.574482,
     "height": 16.1788025
    }
   } ],
  "bounding-box": {
   "x": 13.5319223,
   "y": 33.2388916,
   "width": 24.574482,
   "height": 16.1788025
  }
 } ]

Shape block

A Shape block corresponds to the output of Shape Recognizer analysis.

In addition to common block properties, a Shape block also has the following specific property:

PropertyDescriptionContent
elementsArray of shape elementsAn array of shape elements

Example:

{
  "version": "3",
  "type": "Shape",
  "elements": [ ... ]
}

Shape element

Shape elements contain the following properties:

PropertyDescriptionContentNote
bounding-boxExtent of the shapex, y, width, height - 4 numerical values defining a rectangle which upper-left corner is positioned at coordinates (x, y) and of size (width, height)Present in the JIIX export when export.jiix.bounding-box configuration is true
shapeItem composing the shape.A shape item
candidatesList of recognition candidates associated with this shapeAn array of shape itemsCandidates are present in JIIX export when export.jiix.shape.candidates is configured to true. The first candidate in the array corresponds to the shape described on previous line.
itemsList of stroke items associated with this shapeAn array of stroke itemsStrokes are present in JIIX export when export.jiix.strokes is configured to true

Example:

{
 "bounding-box": { ... },
 "shape": { ... },
 "candidates": [ {...} ],
 "items": [ {...} ]
}

Shape item

Shape items contain the following properties:

PropertyDescriptionContentNote
kindrecognized shape kind.A string corresponding to one of the following shapes: line, polyline, polygon, triangle, isosceles triangle, right triangle, right isosceles triangle, equilateral triangle, quadrilateral, trapezoid, parallelogram, rhombus, rectangle, square, ellipse, circle, arc of ellipse, arc of circle, double arrow, arrow, polyline arrow, polyline double arrow, curved arrow, curved double arrow.If no shape was recognized, value is rejected.
primitivesPrimitives of the shape.An array of shape primitives.

Example:

  "shape": {
   "kind": "arrow",
   "primitives": [ {
     "type": "line",
     "x1": 97.8697891,
     "y1": 148.372635,
     "x2": 151.793411,
     "y2": 148.372635,
     "startDecoration": "none",
     "endDecoration": "arrow-head"
    } ]
  }

Shape primitive

Shape primitives content depend on the shape kind:

  • line primitive

For triangle, isosceles triangle, right triangle, right isosceles triangle, equilateral triangle, quadrilateral, trapezoid, parallelogram, rhombus, rectangle, square, primitives are an array of line primitives representing their edges and contain the properties:

PropertyDescriptionContent
typeprimitive typeline
x1X coordinate of the first point defining the lineA number
y1Y coordinate of the first point defining the lineA number
x2X coordinate of the second point defining the lineA number
y2Y coordinate of the second point defining the lineA number

For line, polyline, double arrow, arrow, polyline arrow and polyline double arrow primitives are line primitives too, that contain the following additional properties:

PropertyDescriptionContent
startDecorationDecoration of a "line" start pointarrow-head in case an arrow head is present, none when no decoration
endDecorationDecoration of a "line" end pointarrow-head in case an arrow head is present, none when no decoration
  • arc primitive

For ellipse, circle, arc of ellipse, arc of circle primitives are an arc primitive representing their edge and contain the properties:

PropertyDescriptionContent
typeprimitive typearc
cxX coordinate of the arc centerA number
cyY coordinate of the arc centerA number
rxx-axis or semi-major radiusA number (must be positive)
ryy-axis or semi-minor radiusA number (must be positive)
phix-axis rotation angleA number
startAngleStart angle (prior to stretch and rotate)A number
sweepAngleSweep angle (prior to stretch and rotate)A number

For curved arrow and curved double arrowprimitive is an arc too, that contains the following additional properties:

PropertyDescriptionContent
startDecorationDecoration of an "arc" item start pointarrow-head in case an arrow head is present, none when no decoration
endDecorationDecoration of an "arc" item end pointarrow-head in case an arrow head is present, none when no decoration

Raw Content Recognizer block

It corresponds to the output of raw digital ink analysis and recognition made by the Raw Content Recognizer.

It is meant to express a classification of ink corresponding to ink interpretation as text, shape, math, decoration, or drawing type depending on recognizer.raw-content.classification value. Results are expressed as a hierarchy of items.

A block of type Raw Content has the common block properties, plus the following specific property:

PropertyDescriptionContent
rangeOnly present in the JIIX export when export.jiix.ranges is configured to trueAn array of ink intervals
elementsArray of items, which types depend on recognizer.raw-content.classification and recognizer.raw-content.recognition valuesAn array of Text, Shape, Math, Decoration and Drawing block objects

Example:

{
 "version": "3",
 "id": "MainBlock",
 "type": "Raw Content",
 "bounding-box": {
    ...
 },
 "range": [
  { "from": { "stroke": 0 }, "to": { "stroke": 135 } }
 ],
  "elements": [ ... ]
}
  • range

When the export.jiix.ranges configuration is enabled, every object in the JIIX file contains a range which is an array of ink intervals. An ink interval is defined by two ink cursors: from and to corresponding to its stroke indexes. The stroke index is the zero based index of the stroke of the object based on the sequence of pointer events composing the input of the recognizer.

Example:

   "range": [
    { "from": { "stroke": 0 }, "to": { "stroke": 105 } },
    { "from": { "stroke": 128 }, "to": { "stroke": 135 } }
   ],
  • Text block object

Text recognition is performed by a new mixed math and text recognizer. So, a text block object may contain mixed math and text.

This new recognizer does not provide character nor word segmentation yet. So, export.jiix.text.chars, export.jiix.text.words and export.jiix.text.structure are ignored.

Text block objects are segmented into lines and each line is segmented into spans. They have a bounding box and the following specific properties:

PropertyDescriptionContentNote
labelRecognition result associated with this text blockA stringThe label includes the line break if applicable.
linesThe array of lines that make up this text block.A array of Line item blocks

Example:

{
 "type": "Text",
 "bounding-box": { ... },
 "range": [ ... ],
 "label": "The root of the quadratic equation\n$a x ^{2} + b x + c = 0$\nis given by the quadratic formula\n$x = \\frac{- b \\pm \\sqrt{\\Delta}}{2 a}$ where $\\bigtriangleup$ is the\ndiscriminant",
 "lines": [ ... ]
}

The item of type Line has a bounding box and the following specific properties:

PropertyDescriptionContentNote
labelRecognition result associated with this lineA stringThe label of lines does not include the line break, which is added at block level if applicable.
spansThe array of spans that make up this line.A array of Math and Text objectsSee below example.

Example:

{
     "type": "Line",
     "bounding-box": { ... },
     "range": [ ... ],
     "label": "$x = \\frac{- b \\pm \\sqrt{\\Delta}}{2 a}$ where $\\bigtriangleup$ is the",
  "spans": [ {
     "type": "Math",
     "bounding-box": { ... },
     "range": [
      { "from": { "stroke": 52 }, "to": { "stroke": 56 } },
      { "from": { "stroke": 128 }, "to": { "stroke": 135 } }
     ],
     "label": "x = \\frac{- b \\pm \\sqrt{\\Delta}}{2 a}"
    }, {
     "type": "Text",
     "bounding-box": { ... },
     "range": [
      { "from": { "stroke": 57 }, "to": { "stroke": 59 } }
     ],
     "label": "where"
    }, {
     "type": "Math",
     "bounding-box": { ... },
     "range": [
      { "from": { "stroke": 60 }, "to": { "stroke": 60 } }
     ],
     "label": "\\bigtriangleup"
    }, {
     "type": "Text",
     "bounding-box": { ... },
     "range": [
      { "from": { "stroke": 61 }, "to": { "stroke": 66 } }
     ],
     "label": "is the"
    } ]
}
Please note that Math spans give the LaTeX string without $ delimiters, while the surrounding line and block add $ delimiters around it.
  • Math block item

Math recognition is done by the "Math" recognizer and therefore only returns recognition results as a LaTeX strings.

Math block objects are segmented into lines and each line is segmented into spans like Text block objects. See the section above for more details about lines and spans.

PropertyDescriptionContentNote
labelRecognition result associated with this math blockA stringThe label LaTeX string with $ delimiters
linesThe array of lines that make up this math block.A array of Line item blocks

Example:

{
 "type": "Math",
 "bounding-box": { ... },
 "range": [ ... ],
 "label": "$\\Delta = b ^{2} - 4 a c$",
 "lines": [ ... ]
}
  • Shape item block

A block of type Shape is similar to Shape block with optional range objects, when export.jiix.ranges configuration is enabled.

Example:

{
 "type": "Shape",
 "bounding-box": { ... },
 "range": [
  { "from": { "stroke": 106 }, "to": { "stroke": 109 } },
  { "from": { "stroke": 125 }, "to": { "stroke": 127 } }
 ],
 "elements": [
  {
   "bounding-box": { ... },
   "range": [
    { "from": { "stroke": 106 }, "to": { "stroke": 106 } }
   ],
   "shape": {
    "kind": "rectangle",
    "primitives": [ ... ]
   }
  },
  ...
  {
   "bounding-box": { ... },
   "range": [
    { "from": { "stroke": 126 }, "to": { "stroke": 127 } }
   ],
   "shape": {
    "kind": "curved arrow",
    "primitives": [ ... ]
   }
  } ]
}
  • Decoration item block

When decorations are detected in the content (requires “decoration” item in the recognizer.raw-content.classification.types array) a Decoration block will appear in the elements of the Main block.

There are 3 types of decoration: “Underline”, “StrikeThrough”, and “Grouping”: A "Grouping" is a decoration that looks like text parentheses (, ), {, }, [, ], or | but groups other elements and may appear horizontally.

  • When “decoration” is missing in the recognizer.raw-content.recognition.types array, the Decoration block contains at most one element for each type without further information.
  • When “decoration” is present in the recognizer.raw-content.recognition.types array, the elements array lists each decoration separately with its type and, when type is “Underline” or “StrikeThrough”, the position of the fitted line segment as x1, y1, x2, y2.

Example:

{
 "type": "Decoration",
 "bounding-box": { ... },
 "range": [
  { "from": { "stroke": 174 }, "to": { "stroke": 178 } }
 ],
 "elements": [ {
   "type": "Grouping",
   "bounding-box": { ... },
   "range": [
    { "from": { "stroke": 174 }, "to": { "stroke": 174 } }
   ]
  }, {
   "type": "Grouping",
   "bounding-box": { ... },
   "range": [
    { "from": { "stroke": 175 }, "to": { "stroke": 175 } }
   ]
  }, {
   "type": "StrikeThrough",
   "x1": 20.9924412,
   "y1": 150.043182,
   "x2": 47.2008286,
   "y2": 150.043182,
   "bounding-box": { ... },
   "range": [
    { "from": { "stroke": 178 }, "to": { "stroke": 178 } }
   ]
  }, {
   "type": "Underline",
   "x1": 69.8855133,
   "y1": 74.2817154,
   "x2": 120.709824,
   "y2": 74.2817154,
   "bounding-box": { ... },
   "range": [
    { "from": { "stroke": 176 }, "to": { "stroke": 176 } }
   ]
  }, {
   "type": "Underline",
   "x1": 18.0531464,
   "y1": 88.0613861,
   "x2": 68.8774567,
   "y2": 88.0613861,
   "bounding-box": { ... },
   "range": [
    { "from": { "stroke": 177 }, "to": { "stroke": 177 } }
   ]
  } ]
}
  • Drawing item block

A block of type Drawing corresponds to a block of ink that was not classified as one of the other content types. It contains the properties common to all blocks including optional range objects, when export.jiix.ranges configuration is enabled.

Example:

{
 "type": "Drawing",
 "bounding-box": { ... },
 "range": [
  { "from": { "stroke": 113 }, "to": { "stroke": 114 } },
  { "from": { "stroke": 120 }, "to": { "stroke": 120 } }
 ],
}