Show / Hide Table of Contents

ThermalLabel Web Editor – JavaScript API Reference

Complete reference of the public JavaScript API exposed by the ThermalLabel Web Editor (ThermalLabelWebEditor-16.0.xx.xxxx.js).

For a feature-oriented overview (zooming, snapping, duplex, theming, clipboard, shortcuts…) read the Web Label Editor guide first. This document is the exhaustive member-by-member reference.

Table of Contents

  • Conventions
  • Namespaces
  • Neodynamic.Web.Editor.ThermalLabelEditor
    • Static properties
    • Constructor
    • Instance properties
    • Methods – lifecycle & view
    • Methods – items & selection
    • Methods – grouping
    • Methods – layout & z-order
    • Methods – undo / redo
    • Methods – clipboard
    • Methods – server operations
    • Methods – helpers
    • Hooks (overridable events)
  • Editor enums
  • Neodynamic.SDK.Printing – Label model
    • ThermalLabel
    • ThermalLabelPage
    • Item (base class)
    • ShapeItem and ClosedShapeItem (base classes)
    • TextItem
    • BarcodeItem
    • ImageItem
    • RectangleShapeItem
    • EllipseShapeItem
    • LineShapeItem
    • TableShapeItem, TableRow, TableColumn
    • RepeaterItem
    • RFIDTagItem
    • LiteralItem
  • Value classes
  • SDK enums
  • Neodynamic.Web.Utils
  • Server request protocol
  • Known gotchas

Conventions

Topic Convention
Naming Public members use snake_case (active_tool, data_field). Members that start with _ are internal and not part of the public API. Methods and hooks of the editor use camelCase (loadThermalLabel, selectionChanged), with a few exceptions listed in the tables.
Units Geometry properties (x, y, width, height, bar_width, stroke_thickness, …) are expressed in the item's unit_type. Internally everything is stored as 96-DPI pixels, and the getters/setters convert on the fly. Changing unit_type on an item reinterprets the stored value in the new unit (the physical size is preserved).
Font sizes Font.size is expressed in Font.unit (FontUnit), independent of unit_type.
Colors *_color properties take the Color enum (Black/White). *_color_hex properties take a CSS hex string (e.g. "#FF0000") and override the enum when non-empty.
Enums Enum properties accept the numeric enum value (e.g. Printing.Color.Black).
Composite values FrameThickness and RectangleCornerRadius getters on several items return a copy (see Known gotchas). Assign a new object to change them.
Sync / async Server methods that return data are synchronous when no callback is given, and asynchronous when you pass one. Prefer callbacks.
Types Types are written in TypeScript notation. ? marks an optional parameter.

Namespaces

Namespace Content
Neodynamic.Web.Editor ThermalLabelEditor, UndoManager and the editor enums
Neodynamic.SDK.Printing Label model (ThermalLabel, items, value classes) and SDK enums
Neodynamic.Web.Utils Helpers (units, math, cloning, parsing, masks…)

Neodynamic.Web.Editor.ThermalLabelEditor

Visual label designer. It manages the design surface, selection, zoom, undo/redo, clipboard and the communication with the server.

Static properties

Property Type Default Description
thermalLabelWebEditorControllerName string "" Required. Relative URL of your MVC Controller action / HTTP Handler (e.g. "ThermalLabelWebEditorHandler/ProcessRequest").
websiteRootAbsoluteUrl string "" Absolute root URL used to build server URLs. When empty, location.protocol + "//" + location.host is used.
clipboardDebug boolean false Logs clipboard diagnostics to the browser console.
CLIP_SIGNATURE string "neodynamic-tlwe/clipboard" Signature of the system-clipboard envelope. Read-only constant.
CLIP_VERSION number 1 Version of the system-clipboard envelope. Read-only constant.
CLIP_MAX_CHARS number 26214400 Maximum size (characters) of a pasteable envelope. Read-only constant.
var TLE = Neodynamic.Web.Editor.ThermalLabelEditor;
TLE.thermalLabelWebEditorControllerName = "ThermalLabelWebEditorHandler/ProcessRequest";

Constructor

new ThermalLabelEditor(container)

Parameter Type Description
container string A jQuery selector (e.g. "#editorHost") of the element that hosts the editor. Passing a DOM element or jQuery object is not supported.

After constructing it you must call enableEditor() and then loadThermalLabel().

var editor = new Neodynamic.Web.Editor.ThermalLabelEditor("#editorHost");
editor.enableEditor();

Instance properties

Tools, state and read-only info

Property Type Access Default Description
active_tool EditorTool get/set Pointer Active drawing tool. Setting anything other than Pointer makes existing items non-selectable until the tool returns to Pointer.
active_tool_item Item get/set – Item instance that will be created by the active tool when the user drags on the surface.
active_page_index number get/set 0 Visible side of a duplex label (0 front, 1 back). The value is clamped to the valid range; no animation (use flipPage() for that).
current_selection Item \| null get null Currently selected item.
get_thermal_label ThermalLabel get – The label being edited (live reference, not a copy).
view_rotation Rotate get None Current view rotation. Use rotateView() to change it.
can_undo boolean get – true if there is a state to undo.
can_redo boolean get – true if there is a state to redo.
group_started boolean get – true while a click-to-group operation or a temporary group is active.
items_in_started_group number get – Number of items added so far to the group being created.
undoRedo boolean get/set false Free flag reserved for your app. The editor does not use it.

Display

Property Type Default Description
zoom number 100 Zoom in percent. Values outside 10–1000 are ignored; the value is rounded to an integer.
show_ruler boolean true Shows/hides the rulers.
show_grid boolean false Shows/hides the grid.
grid_size number 15 px Grid spacing in label units. Requires a loaded label.
grid_type GridType Lines Grid appearance.
adorner_out_of_label_visible boolean true Draws a dashed border around items that are (even partially) outside the label.
num_of_fractional_digits number 4 Decimal digits shown in the width/height indicators of the selection frame.
rfid_tag_image_file_name string "" URL of the icon displayed for RFIDTagItem objects. Updates existing items when set.
literal_image_file_name string "" URL of the icon displayed for LiteralItem objects. Updates existing items when set.

Snapping and editing behavior

Property Type Default Description
snap_to_grid boolean false Snaps position and size to the grid when drawing, moving and resizing.
snap_to_items boolean false Shows smart guides and snaps to the edges/center of other items while dragging.
angle_snap number 5 Rotation step in degrees. 0 disables it.
clipboard_mode EditorClipboardMode Internal Internal (in-memory) or System (OS clipboard). Also accepts the enum name as a string.

Methods – lifecycle & view

enableEditor()

Builds the editor infrastructure (design-surface container, icons, adorners). Call it once, right after the constructor and before loading a label.

loadThermalLabel(tl, options?)

Loads a label into the editor, replacing whatever was there.

Parameter Type Description
tl ThermalLabel Label to edit. The editor edits this instance (it is not cloned).
options.resetUndoHistory boolean Default true. Clears the undo/redo history and stores the initial state.
options.resetActivePage boolean Default true. Returns to page 0 and resets the view rotation.

The editor installs internal change handlers on tl so that changes to width, height, unit_type, shape and is_duplex_design re-render the editor.

editor.loadThermalLabel(Printing.ThermalLabel.createFromXmlTemplate(xml));
// Refresh keeping history and page:
editor.loadThermalLabel(editor.get_thermal_label, { resetUndoHistory: false, resetActivePage: false });

dispose() / destroy()

Releases everything the editor created: document-level clipboard/keyboard listeners, resize observer, rulers, Fabric canvases and DOM nodes. Idempotent. Call it before removing the host from the DOM.

centerEditor()

Re-centers the design surface in the host. Needed only when the host size changes in a way a ResizeObserver cannot detect.

rotateView(viewRotation)

Rotates the view in 90° steps. Items are repositioned and rotated; exported data is normalized back to the original orientation. Selection is preserved. The change is stored in the undo history.

Parameter Type Description
viewRotation Rotate None, Degree90, Degree180 or Degree270.

flipPage()

On a duplex label, animates a 3D flip to the other side. Ignored if the label is not duplex or a flip is already running.

getStyleValue(styleName)

Returns the computed value of a CSS custom property read from the editor's style element.

Parameter Type Description
styleName string For example "--grid-color".

Returns string.

hideItemTooltip() / updateItemTooltip(x, y)

Hide the hover tooltip, or show it at page position x, y (pixels). Mostly useful if you replace the tooltip behavior.

Methods – items & selection

addItem(item)

Adds an item to the label, selects it and refreshes it. The item's coordinates (x, y, width, height) are taken from the item itself and are interpreted in the label's unit (a TableShapeItem in a different unit is converted).

var bc = new Printing.BarcodeItem();
bc.symbology = Printing.BarcodeSymbology.QRCode;
bc.code = "https://example.com";
bc.x = 0.2; bc.y = 0.2; bc.width = 1; bc.height = 1;
editor.addItem(bc);

Adding an item by pushing it to label.items does not put it on the design surface. Use addItem.

updateSelectionItemsProperties()

Re-renders the selected item after you changed its properties by code. For TextItem, BarcodeItem, ImageItem and TableShapeItem this triggers a server render.

saveCurrentLabelCanvasState()

Synchronizes every item with the canvas and pushes a new undo state. Call it after you change items by code.

deleteSelectedItems(skipDeleteConfirmation?)

Deletes the selected item and the members of its group.

Parameter Type Default Description
skipDeleteConfirmation boolean false If false, the currentSelectionBeforeDelete hook is called and may cancel the deletion.

deleteAll()

Removes all items. On a duplex label, only the items of the active page are removed.

lockSelectedItems() / unlockSelectedItems()

Lock/unlock the selection (and its group). Locked items cannot be moved, resized or rotated.

moveSelectedItems(deltaX, deltaY)

Moves the selection (and its group) by the given offsets, in label units. Tray items are ignored.

selectAll()

Selects all items except tray items (all items of the active page).

Returns number – number of selected items.

selectItemByIndex(itemIndex) / selectItemByName(itemName)

Select a single item by its index in label.items or by name (first match).

selectItemsByNames(itemNames) / selectItemsByTag(tag) / selectItemsByType(itemType) / selectItemsByIndexes(itemIndexes)

Method Parameter Description
selectItemsByNames string[] Items whose name is in the list.
selectItemsByTag string Items with that tag.
selectItemsByType string A class name of Neodynamic.SDK.Printing, e.g. "BarcodeItem", "TextItem". Subclasses are not matched.
selectItemsByIndexes number[] Items at those indexes of label.items.

All the select* methods return number (items selected, 0 if none). When several items are selected, a temporary group is created. The editor changes the active page if needed and switches the tool back to Pointer.

var n = editor.selectItemsByType("BarcodeItem");
if (n > 0) editor.alignItems(Neodynamic.Web.Editor.LayoutAlignment.Left);

Methods – grouping

Method Returns Description
startGroup() void Starts a click-to-group operation. Every item selected afterwards is added.
createGroup() void Commits the group being created or keeps a temporary (marquee) group as permanent.
cancelGroup() void Cancels the group operation or dissolves the temporary group.
unGroup() void Dissolves the group of the current selection (clears group_name).
getItemsInGroup(groupName, cloneItems?) Item[] Items (editable and visible) of a group. If cloneItems is true, returns clones.

Methods – layout & z-order

alignItems(alignment, items?, pivotItem?)

Parameter Type Description
alignment LayoutAlignment Alignment or distribution to apply.
items Item[] Optional. Defaults to the current selection (or its group). At least 2 items are needed (3 for distribute).
pivotItem Item Optional reference item for Left, Right, Top, Bottom. Defaults to the current selection.

CenterHorizontal / CenterVertical align to the center of the widest / tallest item.

setSelectedItemsToSameSize(sameWidth, sameHeight, items?, pivotItem?)

Gives the items the width and/or height of the pivot item.

bringForward() / bringToFront() / sendBackward() / sendToBack()

Change the Z-order of the selection (and its group). label.items is reordered accordingly, so print order matches.

Methods – undo / redo

Method Description
undo() Restores the previous state (and re-renders items). Does nothing if can_undo is false.
redo() Re-applies the next state. Does nothing if can_redo is false.

Methods – clipboard

Method Description
clipboardCopy() Copies the selection (and its group).
clipboardCut() Cuts the selection.
clipboardPaste() Pastes using the current clipboard_mode. In System mode the paste is asynchronous.
duplicateSelectedItems() Copies and pastes in one step without altering the clipboard content.

Methods – server operations

All these methods accept an optional custom_url; when empty the editor builds it from websiteRootAbsoluteUrl / thermalLabelWebEditorControllerName. When an xml_label_template is supplied, the server uses it instead of the label being edited. If data_source_format and data_source are given, they are sent as "<format>:<base64>" so the server can bind data_field items (format identifiers are those supported by your server component, typically "xml" or "json").

save(file_name?, custom_url?, format?)

Submits a form that makes the browser download the template.

Parameter Type Default Description
file_name string – Suggested file name.
custom_url string – Alternative handler URL.
format string "xml" "xml" or "json".

getXmlTemplate(custom_url?, callback?) / getJsonTemplate(custom_url?, callback?)

Return the label as a template.

Parameter Type Description
custom_url string Optional alternative URL.
callback (template: string) => void If provided, the call is asynchronous.

Returns string when synchronous, otherwise undefined.

editor.getXmlTemplate(null, function (xml) { localStorage.setItem("label", xml); });

getSupportedExpressions(custom_url?, callback?)

Returns the list of expressions supported by the server (parsed JSON array).

getLabelPreview(xml_label_template, custom_url, out_format, data_source_format, data_source, callback)

Parameter Type Description
xml_label_template string \| null Template to preview, or null for the label being edited.
custom_url string \| null Alternative URL.
out_format string Output format understood by your server (e.g. "html").
data_source_format string \| null Data source format.
data_source string \| null Data source content.
callback (data: string) => void Optional.

getLabelAsHtml(xml_label_template, custom_url, data_source_format, data_source, callback)

Shortcut of getLabelPreview(..., "html", ...).

getLabelThumbnail(size, xml_label_template, custom_url, callback)

Parameter Type Description
size number Thumbnail size in pixels.

getLabelAsImage(xml_label_template, custom_url, imgSettings, dpi, data_source_format, data_source, callback)

Parameter Type Description
imgSettings ImageSettings Output format and options. Defaults to JPEG 80.
dpi number Output resolution.

getLabelAsPdf(xml_label_template, custom_url, pdfMetadata, dpi, data_source_format, data_source, callback)

Parameter Type Description
pdfMetadata PdfMetadata Document properties and drawing mode.
dpi number Resolution used to rasterize bitmaps.

getPrinterCommands(xml_label_template, custom_url, print_language, print_orientation, copies, replicates, dpi, data_source_format, data_source, callback)

Parameter Type Description
print_language ProgrammingLanguage ZPL, EPL, Fingerprint, ESC/POS, PCL or Direct Protocol.
print_orientation PrintOrientation Rotation of the output.
copies number Number of copies.
replicates number Number of replicates of each label.
dpi number Printer resolution.
var P = Neodynamic.SDK.Printing;
editor.getPrinterCommands(null, null, P.ProgrammingLanguage.ZPL, P.PrintOrientation.Portrait,
    1, 1, 203, null, null, function (zpl) { console.log(zpl); });

print(custom_url?, data_source_format?, data_source?)

Registers a print job on the server (Action=Print) and launches TLClientPrint through the tlprint: URL protocol. Windows clients only. Errors go to onError.

Methods – helpers

See getStyleValue, hideItemTooltip and centerEditor.

Hooks (overridable events)

Hooks are no-op functions on the instance. Assign your own function to receive the notification.

Hook Signature Raised when
newItemCreated () => void An item was drawn by the user, pasted or duplicated. The new item is current_selection.
selectionChanged () => void Selection changed or was cleared.
selectionItemPropertyChanged () => void A property setter of the selected item was called. this is the item.
currentSelectionBeforeDelete () => boolean Before deleteSelectedItems(). Return false to cancel.
currentSelectionAfterDelete () => void After a deletion.
undoStateChanged () => void Undo/redo state changed (new step, undo or redo).
viewRotationChanged () => void The view rotation changed.
beforeDuplexDesignDisabled (itemsToRemove: Item[]) => boolean Duplex is being turned off and items live outside page 0. Return false to cancel.
onError (errMsg: string, className: string) => void Server error, image load error or invalid operation. className is the source ("TextItem", "BarcodeItem", "ThermalLabelEditor"…).
editor.onError = function (msg, source) { console.error("[" + source + "]", msg); };
editor.beforeDuplexDesignDisabled = function (items) { return confirm("Remove " + items.length + " items?"); };

Every item also has its own onError(errMsg, className) and propertyChanged() hooks (see Item).


Editor enums

Namespace: Neodynamic.Web.Editor.

Enum Values
EditorTool Pointer=0, Rectangle=1, Ellipse=2, Line=3, Text=4, Barcode=5, Image=6, Literal=7, RFIDTag=8, Table=9, Repeater=10
EditorClipboardMode Internal=0, System=1
GridType Lines=0, Dots=1
LayoutAlignment Left=0, Right=1, Bottom=2, Top=3, CenterHorizontal=4, CenterVertical=5, DistributeHorizontal=6, DistributeVertical=7
Rotate None=0, Degree90=1, Degree180=2, Degree270=3

UndoManager

Internal history stack used by the editor (Neodynamic.Web.Editor.UndoManager). Members: clear(), canUndo, canRedo, saveState(label, viewRotation), undo(), redo(). States are full clones of the label. Use the editor methods instead of calling it directly.


Neodynamic.SDK.Printing – Label model

ThermalLabel

Root object of a label design.

Properties

Property Type Default Description
unit_type UnitType Inch Measurement unit of the label and its items. Setting it updates every item's unit_type.
width number 1 in Label width (unit).
height number 1 in Label height (unit).
shape LabelShape Rectangle Rectangular or elliptical label.
margin FrameThickness 0 Non-printable margins (unit). Getter returns a copy.
gap_length number 0 Gap between labels (unit).
labels_horizontal_gap_length number 0 Horizontal gap between labels (unit).
labels_per_row number 1 Labels per row on the media.
mark_length number 0 Length of the black mark (unit).
offset_length number 0 Offset length (unit).
is_continuous boolean false Continuous media.
items Item[] [] Items of the label, in print (Z) order.
pages ThermalLabelPage[] [] Pages (front/back) when duplex.
is_duplex_design boolean false Two-sided label. Changing it creates/removes the pages.
expressions string[] [] Label expressions.
data_member string "" Data member for data binding.
data_source any null Data source object.
data_source_culture_info string "" Culture used to format data.
data_field_replicates string "" Data field that drives replicates.
print_speed string "" Print speed.
print_mirror boolean false Mirror the output.
cut_after_printing boolean false Cut after printing.
darkness number -1000 Print darkness (-1000 = printer default).
batch_cut number 1 Cut every N labels.
use_default_media_type boolean false Use the printer's default media type.
sheet_labels_width number 0 Sheet-labels width (unit).
sheet_labels_height number 0 Sheet-labels height (unit).
sheet_labels_count number 0 Number of labels in a sheet.
sheet_labels_margin FrameThickness 0 Sheet margins (unit). Getter returns a copy.
design_background_image string "" Base64 PNG shown behind the design (design-time only).
tag string "" Free-use tag.

Static methods

ThermalLabel.createFromXmlTemplate(xmlTemplate)

Parses an XML template into a ThermalLabel and triggers the first render of its items.

Parameter Type Description
xmlTemplate string XML template.

Returns ThermalLabel.

ThermalLabel.createFromJsonTemplate(jsonTemplate)

Same as above for JSON templates. Both the current format (items with typeName) and the legacy format (root thermalLabel object) are accepted. Keys are case-insensitive.

Parameter Type Description
jsonTemplate string \| object JSON text or already-parsed object.

Returns ThermalLabel.

var label = Neodynamic.SDK.Printing.ThermalLabel.createFromJsonTemplate(json);
editor.loadThermalLabel(label);

ThermalLabelPage

Describes one side of a duplex label inside the shared coordinate space.

Property Type Description
x, y number Top-left corner of the page (label unit).
width, height number Page size (label unit).

Item (base class)

Base class of all items. Not instantiable on its own.

Properties

Property Type Default Description
name string "" Item name. Used by selectItemByName.
x number 0 Left position (unit).
y number 0 Top position (unit).
unit_type UnitType Inch Unit of the item's geometry.
locked boolean false Prevents move/resize/rotate.
editable boolean true When false the item cannot be selected.
visible boolean true Printed or not. It is always shown at design time with an adorner.
resizable boolean true Allows resizing.
read_only boolean false Blocks content changes (text, code, image source…).
group_name string "" Name of the group the item belongs to.
data_field string "" Field bound to a data source.
data_field_format_string string "" Format string applied to the data field.
expression string "" Expression evaluated at print time.
use_cache boolean false Cache the rendered item.
cache_item_id string "" Cache key.
print_as_graphic boolean false Force printing the item as a bitmap.
comments string "" Designer notes.
tag string "" Free-use tag. Used by selectItemsByTag.

Methods and hooks

Member Description
refresh() Updates the item on the surface. Server-rendered items request a new image.
propertyChanged() Hook, called after any setter. The editor replaces it on the selected item to raise selectionItemPropertyChanged.
onError(errMsg, className) Hook for item-level errors (server render failures, etc.). The editor assigns its own handler.

ShapeItem and ClosedShapeItem (base classes)

Shared by rectangle, ellipse, table and line items.

Property Type Default Defined in Description
width number 1 in ShapeItem Width (unit).
height number 1 in ShapeItem Height (unit).
stroke_color Color Black ShapeItem Outline color.
stroke_color_hex string "" ShapeItem Outline color as hex; wins over stroke_color.
stroke_thickness number 1 px ShapeItem Outline thickness (unit).
stroke_style StrokeStyle Solid ShapeItem Solid, dash or dot.
stroke_style_pattern string "" ShapeItem Custom dash pattern, values separated by \| in item units (e.g. "0.05\|0.03").
fill_color Color White ClosedShapeItem Fill. White is transparent on the design surface.
fill_color_hex string "" ClosedShapeItem Fill as hex; wins over fill_color.

getStrokeStylePattern() returns the dash pattern as number[] in pixels.

TextItem

Text block rendered by the server (printer fonts, TrueType and custom fonts).

Properties

Property Type Default Description
text string "" Text. Setting it validates against validation_regex (throws Error if it does not match), is ignored when read_only, and is truncated to max_length when read.
font Font NativePrinterFontA 10pt Font.
fore_color / fore_color_hex Color / string Black / "" Text color.
back_color / back_color_hex Color / string White / "" Background color.
border_color / border_color_hex Color / string Black / "" Border color.
border_thickness FrameThickness 0 Border thickness (unit). Getter returns a copy.
corner_radius RectangleCornerRadius 0 Rounded corners (unit). Getter returns a copy.
text_padding FrameThickness 0 Inner padding (unit). Getter returns a copy.
width / height number 1 in / 0.5 in Size (unit).
rotation_angle number 0 Degrees 0–360 (throws RangeError otherwise). Native printer fonts are restricted to 90° steps in the editor.
sizing TextSizing None Auto-fit behavior. AutoSize makes the item non-resizable and adapts its size to the text.
text_alignment TextAlignment Left Horizontal alignment.
text_vertical_alignment TextVerticalAlignment Top Vertical alignment.
multiline boolean true Allows several lines.
max_length number 0 Max characters (0 = unlimited).
char_spacing number 0 Extra spacing between characters (unit).
line_spacing number 0 Extra spacing between lines (unit).
min_font_size number 0 Minimum font size for auto-fit modes (unit).
stroke_thickness number 0 Outline thickness of the glyphs (unit).
stroke_color_hex string "" Outline color of the glyphs.
right_to_left boolean false Right-to-left text.
use_slashed_zero boolean false Draws zeros with a slash.
culture_name string "en-US" Culture used to format values.
mask string "" Counter mask.
mask_increment string "" Counter mask increment.
counter_step number 0 Counter step.
counter_use_leading_zeros boolean false Counter with leading zeros.
hide_if_empty boolean false Do not print if the text is empty.
input_mask_pattern string "" Input mask used by the in-place editor (see MaskEditUtils).
input_mask_prompt_char string "_" Prompt character of the input mask.
validation_regex string "" Regular expression that text must match.
validation_error_message string "" Message of the error thrown by text when validation fails.
scaleX / scaleY number 0 Horizontal/vertical scale factors sent to the renderer (0 = not set).
is_in_edit_mode boolean – Read-only. true while in-place editing.

Methods

Method Description
enterInEditMode() Opens the in-place editor (textarea, or masked input when input_mask_pattern is set). Committed on blur or Esc.
refresh() Re-renders the item on the server.

BarcodeItem

Barcode / 2D code rendered by the server. 180+ symbologies (see BarcodeSymbology). Which properties apply to each symbology is returned by BarcodeItemUtils.getRelatedProperties.

Methods

Method Description
refresh() Re-renders the barcode on the server.
printAsResidentElementIsSupported() Asks the server whether the barcode can be printed with the printer's native engine, updates the adorner and switches sizing to AutoSize. Called automatically by refresh() when print_as_resident_element is true.

General

Property Type Default Description
symbology BarcodeSymbology Code39 Barcode type.
code string "1234567890" Data to encode.
code_encoding CodeEncoding Text How code is interpreted (Text, Base64, Hex).
text string "" Extra text drawn with the barcode.
human_readable_text string "" Overrides the human-readable text.
display_code boolean true Shows the human-readable code.
code_alignment BarcodeTextAlignment BelowCenter Position of the code text.
code_format_pattern string "" Format pattern of the code text.
text_alignment BarcodeTextAlignment AboveCenter Position of text.
text_format_pattern string "" Format pattern of text.
font Font default Font of the code text.
text_font Font default Font of text.
fore_color / fore_color_hex Color / string Black / "" Code text color.
text_fore_color / text_fore_color_hex Color / string Black / "" text color.
use_quiet_zone_for_text boolean false Draws the text inside the quiet zone.
hide_if_empty boolean false Do not print if code is empty.
error_behavior BarcodeErrorBehavior BlankImage Blank image or exception on invalid data.
right_to_left boolean false Mirrors the symbol.
print_as_resident_element boolean false Use the printer's native barcode.
mask, mask_increment string "" Counter mask and increment.
counter_step number 0 Counter step.
counter_using_leading_zeros boolean false Counter with leading zeros.

Layout and appearance

Property Type Default Description
width / height number 1 in / 0.5 in Item size (unit).
rotation_angle number 0 Rounded to multiples of 90.
sizing BarcodeSizing None Sizing mode. AutoSize makes the item non-resizable.
barcode_alignment BarcodeAlignment TopLeft Alignment of the symbol inside the item.
barcode_padding FrameThickness 0 Padding (unit). Getter returns a copy.
quiet_zone FrameThickness 0.1, 0, 0.1, 0.02 in Quiet zone (unit). Getter returns a copy.
border_thickness FrameThickness 0 Border; not unit-converted.
border_color / border_color_hex Color / string Black / "" Border color.
corner_radius RectangleCornerRadius 0 Rounded corners; not unit-converted.
back_color / back_color_hex Color / string White / "" Background color.
bar_color / bar_color_hex Color / string Black / "" Bar/module color.

1D symbologies

Property Type Default Description
bar_height number 0.5 in Bar height (unit).
bar_width number ~0.0104 in Narrow bar / module width (unit).
bar_ratio number 2 Wide-to-narrow ratio.
bar_width_adjustment number 0 Fine adjustment of bar width (printer dots).
bearer_bar_style BearerBarStyle None Bearer bars.
bearer_bar_thickness number 0.05 in Bearer bar thickness (unit).
add_checksum boolean true Adds the checksum character.
display_checksum boolean true Shows the checksum in the text.
display_start_stop_char boolean true Shows start/stop characters.
codabar_start_char / codabar_stop_char CodabarStartStopChar A Codabar guards.
code128_charset Code128 Auto Code 128 subset.
code16k_mode Code16K Mode1 Code 16K mode.
code39_full_ascii_mode boolean true Code 39 Full ASCII.
code93_full_ascii_mode boolean true Code 93 Full ASCII.
code11_two_digits_checksum boolean false Code 11 with two check digits.
msi_checksum MsiChecksum OneMod10 MSI checksum type.
itf14_left_h_mark / itf14_right_h_mark ItfHmark None ITF-14 H marks.
telepen_encoding TelepenEncoding Ascii Telepen mode.
isbt_128_data_structure Isbt128DataStructure DS001 ISBT-128 structure.
segments_per_row number 4 Segments per row (GS1 DataBar Expanded Stacked).
pharmacode_bars_spacing number ~0.0417 in Pharmacode spacing (unit).
pharmacode_thick_bar_width number 0.0625 in Pharmacode thick bar (unit).
pharmacode_thin_bar_width number ~0.0208 in Pharmacode thin bar (unit).
tlc39_micro_pdf417_bar_width number ~0.0104 in TLC39 MicroPDF417 bar width (unit).
tlc39_micro_pdf417_row_bar_height number ~0.0313 in TLC39 MicroPDF417 row height (unit).
gs1_data_strict_validation boolean false Strict GS1 validation.
hibc_format_human_readable_text boolean true HIBC human-readable formatting.
hibc_use_iso_iec_15434_encoding boolean false HIBC ISO/IEC 15434 encoding.

EAN / UPC

Property Type Default Description
ean_upc_guard_bar boolean true Longer guard bars.
ean_upc_guard_bar_height number 0.55 in Guard bar height (unit).
ean_upc_display_light_margin_indicator boolean false Light margin indicators (<, >).
ean_upc_magnification_factor number 0 Magnification (0 = use bar_width).
ean_upc_supplement Supplement None 2- or 5-digit supplement.
ean_upc_supplement_code string "0" Supplement data.
ean_upc_supplement_separation number 0.15 in Gap to the supplement (unit).
ean_upc_supplement_top_margin number 0.15 in Supplement top margin (unit).
upce_system UpcE System0 UPC-E number system.

Postal (4-state, POSTNET, PLANET, FIM, horizontal bars)

Property Type Default Description
postal_4_state_add_start_stop_char boolean true Adds start/stop bars.
postal_4_state_bars_spacing number ~0.0313 in Bar spacing (unit).
postal_4_state_tracker_bar_height number 0.08 in Tracker bar height (unit).
postal_4_state_tracker_bar_width number ~0.0208 in Tracker bar width (unit).
postnet_height_short_bar / postnet_height_tall_bar number 0.1 / 0.2 in POSTNET bar heights (unit).
planet_height_short_bar / planet_height_tall_bar number 0.1 / 0.2 in PLANET bar heights (unit).
usps_fim_pattern FIM A FIM pattern.
usps_horizontal_bars_count number 10 Number of horizontal bars.

Aztec

Property Type Default Description
aztec_code_module_size number ~0.0417 in Module size (unit).
aztec_code_error_correction number 23 Error correction percentage.
aztec_code_format AztecCodeFormat Auto Symbol size.
aztec_code_byte_encoding_name string "ISO-8859-1" Byte-mode encoding.
aztec_code_process_tilde boolean false Process ~ escape sequences.
aztec_code_rune number -1 Aztec Rune value (-1 = disabled).

Data Matrix

Property Type Default Description
data_matrix_module_size number ~0.0417 in Module size (unit).
data_matrix_encoding DataMatrixEncoding Auto Encoding scheme.
data_matrix_format DataMatrixFormat Auto Symbol size.
data_matrix_include_rect_formats_in_auto_mode boolean false Allows rectangular sizes in Auto.
data_matrix_byte_encoding_name string "ISO-8859-1" Byte-mode encoding.
data_matrix_process_tilde boolean false Process ~ escape sequences.
data_matrix_file_id string "001001" File ID (structured append).
data_matrix_symbol_count / data_matrix_symbol_index number 1 / 1 Structured append.

QR Code family

Property Type Default Description
qr_code_module_size number ~0.0417 in Module size (unit).
qr_code_error_correction_level QRCodeErrorCorrectionLevel M Error correction.
qr_code_encoding QRCodeEncoding Auto Encoding mode.
qr_code_version QRCodeVersion Auto Symbol version.
qr_code_mask QRCodeMask Auto Mask pattern.
qr_code_byte_encoding_name string "ISO-8859-1" Byte-mode encoding.
qr_code_process_tilde boolean false Process ~ escape sequences.
microqr_code_version MicroQRCodeVersion Auto Micro QR version.
rect_microqr_code_version RectMicroQRCodeVersion Auto Rectangular Micro QR version.

PDF417 family

Property Type Default Description
pdf417_columns / pdf417_rows number 0 Columns/rows (0 = auto).
pdf417_aspect_ratio number 0 Aspect ratio (0 = auto).
pdf417_error_correction_level Pdf417ErrorCorrection Level2 Error correction.
pdf417_compaction_type Pdf417CompactionType Auto Compaction.
pdf417_truncated boolean false Truncated symbol.
pdf417_byte_encoding_name string "ISO-8859-1" Byte-mode encoding.
pdf417_process_tilde boolean false Process ~ escape sequences.
pdf417_file_id string "000" File ID (Macro PDF417).
pdf417_segment_count / pdf417_segment_index number 0 / 0 Macro PDF417 segments.
micropdf417_version MicroPdf417Version Auto MicroPDF417 version.

Other 2D

Property Type Default Description
han_xin_code_module_size number ~0.0417 in Han Xin module size (unit).
han_xin_code_encoding HanXinCodeEncoding Auto Encoding mode.
han_xin_code_error_correction_level HanXinCodeErrorCorrectionLevel L1 Error correction.
han_xin_code_version HanXinCodeVersion Auto Version.
han_xin_code_byte_encoding_name string "ISO-8859-1" Byte-mode encoding.
han_xin_code_process_tilde boolean false Process ~ escape sequences.
maxi_code_mode MaxiCodeModes Mode4 MaxiCode mode.
maxi_code_symbol_count / maxi_code_symbol_index number 1 / 1 Structured append.
maxi_code_process_tilde boolean false Process ~ escape sequences.
maxi_code_draw_pixel_based_symbol boolean true Draws the symbol with pixels.
dot_code_module_size number ~0.0417 in Dot size (unit).
dot_code_columns / dot_code_rows number 0 0 (auto) or 5–200; other values are ignored.
dot_code_aspect_ratio string "" Aspect ratio.
dot_code_module_shape DotCodeModuleShape Circle Dot or square.
dot_code_process_tilde boolean false Process ~ escape sequences.

Art barcodes

Decorative QR/2D styling.

Property Type Default Description
art_module_shape ArtModuleShape Rect Shape of the modules.
art_finder_shape ArtFinderShape Rect Shape of the finder patterns.
art_bar_image_pattern string "" Image used to fill the modules (base64).
art_logo_image string "" Logo image (base64).
art_logo_image_position LogoPosition Top Logo position.
art_logo_image_percentage number 20 Logo size as a percentage of the symbol.
art_logo_image_opacity number 100 Logo opacity 1–100 (other values are ignored).

ImageItem

Picture rendered by the server, with optional monochrome conversion.

Property Type Default Description
source_base64 string "" Image as raw base64 (no data: prefix). Ignored when read_only.
source_file string "" Image URL (http:/https: only). Any other value shows the missing-image placeholder.
width / height number 0 Size (unit). Setting 0 uses the image's natural size.
rotation_angle number 0 Degrees 0–360 (throws RangeError otherwise).
flip Flip None Mirror.
lock_aspect_ratio LockAspectRatio None Aspect-ratio behavior.
convert_to_monochrome boolean true Convert to black & white when printing.
monochrome_settings MonochromeSettings Otsu, 50, no reverse Conversion options.
is_grayscale_or_black_white boolean false Hint that the source is already grayscale/B&W.
source_dpi number 96 DPI of the source picture.
hide_if_not_found boolean false Do not print when the source cannot be found.
name_at_printer_storage string "" Name of the image stored in the printer.

refresh() re-renders the image on the server; with no source, it displays the missing-image placeholder.

RectangleShapeItem

Inherits ShapeItem / ClosedShapeItem and Item.

Property Type Default Description
corner_radius RectangleCornerRadius 0 Corner radii (unit). Getter returns a copy.
rotation_angle number 0 Degrees 0–360 (throws RangeError otherwise).

EllipseShapeItem

Inherits ShapeItem / ClosedShapeItem and Item.

Property Type Default Description
rotation_angle number 0 Degrees 0–360 (throws RangeError otherwise).

LineShapeItem

Inherits ShapeItem (no fill) and Item.

Member Type Default Description
orientation LineOrientation Horizontal Horizontal, vertical or diagonal. For diagonals, width/height describe the bounding box.
stroke_thickness number 1 px Line thickness (unit).
LineShapeItem.classifyOrientation(angle) static – Returns the LineOrientation for an angle in degrees.

TableShapeItem, TableRow, TableColumn

TableShapeItem inherits ClosedShapeItem and Item. It is rendered by the server.

Property Type Default Description
columns TableColumn[] [] Public array of columns. Modify it, then call refresh().
rows TableRow[] [] Public array of rows.
corner_radius RectangleCornerRadius 0 Rounded corners (unit).
rotation_angle number 0 Rounded to multiples of 90.
columns_line_visible / rows_line_visible boolean true Inner lines.
top_side_visible / bottom_side_visible / left_side_visible / right_side_visible boolean true Outer sides.

TableColumn: width (unit), fill_color (Color), fill_color_hex (string). TableRow: height (unit), fill_color (Color), fill_color_hex (string).

var t = new Printing.TableShapeItem();
["1", "1"].forEach(function (w) { var c = new Printing.TableColumn(); c.width = parseFloat(w); t.columns.push(c); });
var r = new Printing.TableRow(); r.height = 0.5; t.rows.push(r);
t.width = 2; t.height = 0.5;
editor.addItem(t);

RepeaterItem

Design-time container for repeated content (rendered as a translucent rectangle with arrows).

Property Type Default Description
width / height number 1 in Size of one repeated cell (unit).
count number 0 Number of repetitions (0 = driven by data; negatives become 0).
rotation_angle number 0 Rounded to multiples of 90.

RFIDTagItem

Encodes data on an RFID tag. Shown in the tray, not on the label surface.

Property Type Default Description
data_format RFIDTagDataFormat ASCII Format of data_to_encode.
data_to_encode string "" Data to write. Ignored when read_only.
epc_data_structure string "" EPC structure (for EPC format).
tag_type RFIDTagType Default Tag type.
memory_bank string "" Memory bank.
starting_block number -1 Starting block (-1 = default).
number_of_bytes number 0 Number of bytes to write.
access_password / kill_password string "" Passwords.
lock_memory_bank RFIDLockMemoryBank defaults Lock settings.
perma_lock_memory_section RFIDPermaLockMemorySection defaults Permanent-lock settings.

LiteralItem

Raw printer commands sent as-is. Shown in the tray.

Property Type Default Description
text string "" Commands. Ignored when read_only.

Value classes

Class Constructor Members
Font new Font() name ("NativePrinterFontA"), size (10), unit (FontUnit.Point), bold, italic, underline, strikeout (false), code_page (CodePage.CP850), custom_font_file, custom_font_file_family_name, name_at_printer_storage (""), is_bitmap_font (false), threshold (90, range 0–100)
FrameThickness new FrameThickness(left, top, right, bottom) left, top, right, bottom. All four arguments must be provided, otherwise all values are 0.
RectangleCornerRadius new RectangleCornerRadius(top_left, top_right, bottom_right, bottom_left) top_left, top_right, bottom_right, bottom_left. All four arguments must be provided, otherwise all values are 0.
MonochromeSettings new MonochromeSettings() dither_method (OtsuThreshold), reverse_effect (false), threshold (50, range 0–100)
ImageSettings new ImageSettings(image_format?) image_format (Jpeg), jpeg_quality_level (80, 1–100), anti_alias (false), transparent_background (false), png_include_dpi_metadata (false), thumbnail_size (0), scale_x / scale_y (1, must be >= 0)
PdfMetadata new PdfMetadata() author, creator, producer, subject, title (""), use_vector_drawing (false)
RFIDLockMemoryBank new RFIDLockMemoryBank() kill_password, access_password, epc_memory_bank, user_memory_bank (RFIDLockValue, default None), apply (false)
RFIDPermaLockMemorySection new RFIDPermaLockMemorySection() apply (false), starting_section (0), number_of_sections (0)

Changing a property of a Font, FrameThickness or similar object that is already assigned to an item does not notify the item. Call editor.updateSelectionItemsProperties() afterwards.

var f = new Printing.Font();
f.name = "Arial"; f.size = 12; f.unit = Printing.FontUnit.Point; f.bold = true;
textItem.font = f;

SDK enums

Namespace: Neodynamic.SDK.Printing. Values in Name=value form.

Units, geometry and appearance

Enum Values
UnitType Cm=0, Inch=1, Mm=2, DotsPerInch=3, Point=4, Pica=5, Mils=6, Twip=7
FontUnit Inch=0, Millimeter=1, Pixel=2, Point=3, Twip=4
Color Black=0, White=1
StrokeStyle Solid=0, Dash=1, Dot=2
LineOrientation Horizontal=0, Vertical=1, DiagonalUp=2, DiagonalDown=3
LabelShape Rectangle=0, Ellipse=1
Flip None=0, X=1, Y=2, XY=3
LockAspectRatio None=0, WidthBased=1, HeightBased=2, Fit=3

Text

Enum Values
TextSizing None=0, Stretch=1, FontSizeScaling=2, ParagraphScaling=3, Arc=4, Vertical=5, OuterArc=6, ParagraphScalingAndFill=7, AutoSize=8, OverflowSplit=9
TextAlignment Left=0, Center=1, Right=2, Justify=3
TextVerticalAlignment Top=0, Bottom=1, Middle=2
CodePage CP850=0, CP1250=1, CP1251=2, CP1252=3, CP1253=4, CP1254=5, CP1255=6, UTF8=7

Images

Enum Values
DitherMethod Threshold=0, PatternDiffusion=1, FloydSteinberg=2, OtsuThreshold=3
ImageFormat Jpeg=0, Png=1, Svg=2, Pcx=3

Printing and RFID

Enum Values
PrintOrientation Portrait=0, Landscape90=1, Portrait180=2, Landscape270=3
ProgrammingLanguage ZPL=0, EPL=1, Fingerprint=2, ESCPOS=3, PCL=4, DirectProtocol=5
RFIDTagDataFormat ASCII=0, Hexadecimal=1, EPC=2
RFIDTagType Default=0, None=1, EPCClass0=2, EPCClass0Plus=3, EPCClass164bit=4, EPCClass196bit=5, UCODEEPC119=6, ImpinjClass0Plus=7, ISO1800006A=8, EPCClass1Gen2=9, ISO1800006B=10
RFIDLockValue None=0, Lock=1, Open=2, Unlock=3, Protected=4

Barcode – general

Enum Values
BarcodeSizing None=0, Fill=1, FitProportional=2, AutoSize=3
BarcodeAlignment TopLeft=1, TopCenter=2, TopRight=4, MiddleLeft=16, MiddleCenter=32, MiddleRight=64, BottomLeft=256, BottomCenter=512, BottomRight=1024
BarcodeTextAlignment AboveCenter=0, AboveLeft=1, AboveRight=2, AboveJustify=3, BelowCenter=4, BelowLeft=5, BelowRight=6, BelowJustify=7
BarcodeErrorBehavior BlankImage=0, ThrowException=2
BearerBarStyle None=0, Frame=1, HorizontalRules=2
CodeEncoding Text=0, Base64=1, Hex=2

Barcode – 1D options

Enum Values
CodabarStartStopChar A=0, B=1, C=2, D=3
Code128 Auto=0, A=1, B=2, C=3
Code16K Mode0=0, Mode1=1, Mode2=2
MsiChecksum OneMod10=0, TwoMod10=1, Mod11AndMod10=2
ItfHmark None=0, Mark1=1 … Mark7=7
Supplement None=0, Digits2=1, Digits5=2
UpcE System0=0, System1=1
FIM A=0, B=1, C=2, D=3
TelepenEncoding Ascii=0, Numeric=1
Isbt128DataStructure DS001=0 … DS034=33 (sequential)

Barcode – 2D options

Enum Values
QRCodeEncoding Auto=0, Numeric=1, AlphaNumeric=2, Kanji=3, Byte=4
QRCodeErrorCorrectionLevel L=0, M=1, Q=2, H=3
QRCodeVersion Auto=0, V01=1 … V40=40
QRCodeMask Auto=0, Mask0=1 … Mask7=8
MicroQRCodeVersion Auto=0, M1=1, M2=2, M3=3, M4=4
DataMatrixEncoding Auto=0, Ascii=1, C40=2, Text=3, Base256=4
Pdf417CompactionType Auto=0, Binary=1, Text=2, Numeric=3
Pdf417ErrorCorrection Level0=0 … Level8=8
MaxiCodeModes Mode2=2, Mode3=3, Mode4=4, Mode5=5, Mode6=6
HanXinCodeEncoding Auto=0, Numeric=1, Text=2, BinaryByte=3, ChineseReg1=4, ChineseReg2=5, GB18030Bytes2=6, GB18030Bytes4=7
HanXinCodeErrorCorrectionLevel L1=0, L2=1, L3=2, L4=3
HanXinCodeVersion Auto=0, V01=1 … V84=84
DotCodeModuleShape Circle=0, Square=1
ArtModuleShape Rect=0, RoundRect=1, Dot=2, Circle=3, ZebraHorizontal=4, ZebraVertical=5, Diamond=6
ArtFinderShape Rect=0, RoundRect=1, Circle=2
LogoPosition Top=0, Bottom=1

Barcode – symbol sizes

AztecCodeFormat: Auto=0, C15X15Compact=1, C19X19=2, C19X19Compact=3, C23X23=4, C23X23Compact=5, C27X27=6, C27X27Compact=7, C31X31=8, C37X37=9, C41X41=10, C45X45=11, C49X49=12, C53X53=13, C57X57=14, C61X61=15, C67X67=16, C71X71=17, C75X75=18, C79X79=19, C83X83=20, C87X87=21, C91X91=22, C95X95=23, C101X101=24, C105X105=25, C109X109=26, C113X113=27, C117X117=28, C121X121=29, C125X125=30, C131X131=31, C135X135=32, C139X139=33, C143X143=34, C147X147=35, C151X151=36

DataMatrixFormat: Auto=0, AutoDMRE=1, C10X10=2, C12X12=3, C8X18=4, C14X14=5, C8X32=6, C16X16=7, C12X26=8, C18X18=9, C20X20=10, C12X36=11, C22X22=12, C16X36=13, C24X24=14, C26X26=15, C16X48=16, C32X32=17, C36X36=18, C40X40=19, C44X44=20, C48X48=21, C52X52=22, C64X64=23, C72X72=24, C80X80=25, C88X88=26, C96X96=27, C104X104=28, C120X120=29, C132X132=30, C144X144=31, DMRE8X48=32, DMRE8X64=33, DMRE12X64=34, DMRE24X32=35, DMRE26X32=36, DMRE24X36=37, DMRE16X64=38, DMRE26X40=39, DMRE24X48=40, DMRE26X48=41, DMRE24X64=42, DMRE26X64=43

MicroPdf417Version: Auto=0, V1X11=1, V1X14=2, V1X17=3, V1X20=4, V1X24=5, V1X28=6, V2X8=7, V2X11=8, V2X14=9, V2X17=10, V2X20=11, V2X23=12, V2X26=13, V3X6=14, V3X8=15, V3X10=16, V3X12=17, V3X15=18, V3X20=19, V3X26=20, V3X32=21, V3X38=22, V3X44=23, V4X4=24, V4X6=25, V4X8=26, V4X10=27, V4X12=28, V4X15=29, V4X20=30, V4X26=31, V4X32=32, V4X38=33, V4X44=34

RectMicroQRCodeVersion: Auto=0, R7x43=1, R7x59=2, R7x77=3, R7x99=4, R7x139=5, R9x43=6, R9x59=7, R9x77=8, R9x99=9, R9x139=10, R11x27=11, R11x43=12, R11x59=13, R11x77=14, R11x99=15, R11x139=16, R13x27=17, R13x43=18, R13x59=19, R13x77=20, R13x99=21, R13x139=22, R15x43=23, R15x59=24, R15x77=25, R15x99=26, R15x139=27, R17x43=28, R17x59=29, R17x77=30, R17x99=31, R17x139=32

BarcodeSymbology

Values 79 and 146 are not used.

Codabar=0, Code11=1, Code16k=2, Code39=3, Code93=4, Code128=5, DataMatrix=6, Ean8=7,
Ean13=8, Industrial2of5=9, Interleaved2of5=10, Isbn=11, Msi=12, Pdf417=13, Planet=14,
Postnet=15, UccEan128=16, UpcA=17, UpcE=18, UspsOneCode4CB=19, RoyalMail=20,
AustraliaPost=21, RoyalTpgPostKix=22, Sscc18=23, Pzn=24, DeutschePostLeitcode=25,
DeutschePostIdentcode=26, UspsTrayLabel=27, UspsSackLabel=28, EanVelocity=29,
SingaporePost=30, Jan8=31, Jan13=32, SwissPostParcel=33, Opc=34, Ean99=35, Itf14=36,
Scc14=37, Issn=38, Ismn=39, NumlyNumber=40, QRCode=41, UspsFim=42, UspsHorizontalBars=43,
Telepen=44, Pharmacode=45, Semacode=46, Code32=47, UspsPicUccEan128=48, FedExGround96=49,
AztecCode=50, CompactPdf417=51, MacroPdf417=52, MicroPdf417=53, VicsBol=54, VicsScacPro=55,
ItalianPost25=56, Isbt128=57, HibcLic39=58, HibcLic128=59, HibcPas39=60, HibcPas128=61,
UspsIntelligentMail=62, EanUpcAddOn2=63, EanUpcAddOn5=64, UspsPicCode128=65,
GS1DataBarOmnidirectional=66, GS1DataBar14=67, Rss14=68, GS1DataBarTruncated=69,
GS1DataBar14Truncated=70, Rss14Truncated=71, GS1DataBarStacked=72, GS1DataBar14Stacked=73,
Rss14Stacked=74, GS1DataBarStackedOmnidirectional=75, GS1DataBar14StackedOmnidirectional=76,
Rss14StackedOmnidirectional=77, GS1DataBarLimited=78, RssLimited=80, GS1DataBarExpanded=81,
RssExpanded=82, GS1DataBarExpandedStacked=83, RssExpandedStacked=84, GS1128=85, MaxiCode=86,
MicroQRCode=87, Matrix2of5=88, DanishPostal39=89, FrenchPostal39AR=90, IATA2of5=91,
AustraliaPostDomesticEParcelBarcode=92, UspsIntelligentMailContainerBarcode=93,
KodakPatchCode=94, GS1DataMatrix=95,
Ean13CCA=96, Ean13CCB=97, Ean8CCA=98, Ean8CCB=99, UpcACCA=100, UpcACCB=101, UpcECCA=102,
UpcECCB=103, UccEan128CCA=104, UccEan128CCB=105, UccEan128CCC=106, GS1128CCA=107,
GS1128CCB=108, GS1128CCC=109, GS1DataBarOmnidirectionalCCA=110, GS1DataBar14CCA=111,
Rss14CCA=112, GS1DataBarOmnidirectionalCCB=113, GS1DataBar14CCB=114, Rss14CCB=115,
GS1DataBarTruncatedCCA=116, GS1DataBar14TruncatedCCA=117, Rss14TruncatedCCA=118,
GS1DataBarTruncatedCCB=119, GS1DataBar14TruncatedCCB=120, Rss14TruncatedCCB=121,
GS1DataBarLimitedCCA=122, RssLimitedCCA=123, GS1DataBarLimitedCCB=124, RssLimitedCCB=125,
GS1DataBarStackedCCA=126, GS1DataBar14StackedCCA=127, Rss14StackedCCA=128,
GS1DataBarStackedCCB=129, GS1DataBar14StackedCCB=130, Rss14StackedCCB=131,
GS1DataBarStackedOmnidirectionalCCA=132, GS1DataBar14StackedOmnidirectionalCCA=133,
Rss14StackedOmnidirectionalCCA=134, GS1DataBarStackedOmnidirectionalCCB=135,
GS1DataBar14StackedOmnidirectionalCCB=136, Rss14StackedOmnidirectionalCCB=137,
GS1DataBarExpandedCCA=138, RssExpandedCCA=139, GS1DataBarExpandedCCB=140,
RssExpandedCCB=141, GS1DataBarExpandedStackedCCA=142, RssExpandedStackedCCA=143,
GS1DataBarExpandedStackedCCB=144, RssExpandedStackedCCB=145,
Ean14=147, Dun14Itf=148, Dun14Ean=149, GS1QRCode=150, Ppn=151, IFAsecurPharm=152,
DhlAwb=153, HibcLicDataMatrix=154, HibcLicQRCode=155, HibcLicAztecCode=156,
HibcPasDataMatrix=157, HibcPasQRCode=158, HibcPasAztecCode=159, Isbt128DataMatrix=160,
DeutschePostResponsePlusPostMatrix=161, DeutschePostBzl=162, UspsIntelligentMailPackageBarcode=163,
HanXinCode=164, JapanPost=165, KoreaPost=166, DataLogic2of5=167, MailmarkCMDM=168,
Mailmark4StateC=169, Mailmark4StateL=170, DotCode=171, GS1AztecCode=172, SwissQRCode=173,
Plessey=174, EPCQRCode=175, Code49=176, CodablockF=177, Tlc39=178, HibcLicCodablockF=179,
HibcPasCodablockF=180, TriOptic=181, DINSpecQRCode=182, DINSpecDataMatrix=183,
RectMicroQRCode=184, GS1RectMicroQRCode=185, DPDCode=186, DAFT=187

Neodynamic.Web.Utils

Helper classes. All members are static.

UnitUtils

Unit conversion. Pixels are 96-DPI pixels.

Method Returns Description
convertPixelToUnit(value, unit: UnitType) number Pixels → unit.
convertUnitToPixel(value, unit: UnitType) number Unit → pixels.
convertPixelToFontUnit(value, unit: FontUnit) number Pixels → font unit.
convertFontUnitToPixel(value, unit: FontUnit) number Font unit → pixels.
var UU = Neodynamic.Web.Utils.UnitUtils;
UU.convertUnitToPixel(1, Neodynamic.SDK.Printing.UnitType.Inch);   // 96
UU.convertPixelToUnit(96, Neodynamic.SDK.Printing.UnitType.Mm);    // 25.4

MathUtils

Method Returns Description
convertRadToDegrees(rad) / convertDegreesToRad(deg) number Angle conversions.
calcOuterRectOfRotatedRect(x, y, w, h, angle) number[4] Axis-aligned bounding box [x, y, width, height] of a rotated rectangle.
rotatedTopLeft(x, y, width, height, rotationAngle) {left, top} Position of the rotated top-left corner (rotationAngle in radians).
getRotatedBoundingBox(x, y, w, h, angleInDegrees) {x, y, w, h} Bounding box of a rotated rectangle.

Cloner

Deep copy of the label model. Used by undo/redo and the clipboard.

Method Returns
cloneThermalLabel(tl) ThermalLabel
cloneItem(item) Item of the same class
clonePage(page) ThermalLabelPage
cloneTableColumn(column) / cloneTableRow(row) TableColumn / TableRow

RotateUtils

Method Returns Description
rotateLabel(thermalLabel, currentRotateView, newRotateView) ThermalLabel Returns a rotated clone.
rotateLabelInPlace(thermalLabel, currentRotateView, newRotateView) boolean Rotates the given label; false if there was nothing to do.

NamingUtils

Method Returns Description
newGuid() string Random GUID-like identifier.
convertXMLUCS2ToChar(text) string Decodes XML-escaped characters of the form _xHHHH_.

ImageUtils / TextUtils

Method Returns Description
ImageUtils.isPNG(value) boolean true if the string looks like base64 PNG data. Used to detect server render errors.
TextUtils.isEmpty(value) boolean true for null, undefined or "".

MaskEditUtils

Input masking used by the in-place text editor.

Method Description
masking(inputCtrl, mask, promptChar) Applies mask to an <input> element.
getMaskedData(inputCtrl, promptChar) Returns the value if the mask is completely filled, otherwise "".
getMaskElements() Returns the placeholder → regular expression map.
setCaretPosition(ctrl, pos) Moves the caret.

Mask placeholders: 0 digit · 9 digit or space · # digit, space, + or - · L letter · ? letter or space · & any character except space · C any character · A letter or digit · a letter, digit or space. Special: > uppercase following chars, < lowercase following chars, | stop case conversion, \ escape a placeholder. Any other char is a literal.

BarcodeItemUtils

BarcodeItemUtils.getRelatedProperties(symbology)

Returns the list of BarcodeItem property names that are meaningful for a symbology. Use it to build dynamic property grids.

Parameter Type Description
symbology BarcodeSymbology Symbology to query.

Returns string[]

var props = Neodynamic.Web.Utils.BarcodeItemUtils
    .getRelatedProperties(Neodynamic.SDK.Printing.BarcodeSymbology.QRCode);
// ["name", "x", "y", ..., "qr_code_module_size", "qr_code_version", ...]

Server request protocol

Your HTTP Handler / Controller receives POST requests (form-encoded) at thermalLabelWebEditorControllerName. The Action field selects the operation. Item and label data travel as JSON using PascalCase keys (Type, X, Y, Width, UnitType, …); enums travel as numbers.

Action Fields Expected response
Render Type (Text, Barcode, Image, Table), Properties (JSON of the item) Base64 PNG (data must contain a PNG; otherwise the response is treated as an error message)
Validate Type (Barcode), Properties JSON { "printAsResidentElement": boolean, "error": string }
GetLabelTemplate OutFormat (xml/json), Data (label JSON) Template text
Save OutFormat, DataBase64 (UTF-8 base64 of label JSON), FileName? File download
Print Data (label JSON), DataSource? Print job id (used to build the tlprint: URL: ...?webPrintJob=t&LabelID=<id>)
GetLabelPreview Data or XmlTemplate (URL-encoded), OutFormat, DataSource? Preview content
GetLabelThumbnail Data or XmlTemplate, Size Thumbnail (base64)
GetLabelAsImage Data or XmlTemplate, DataSource?, Dpi, ImageFormat, JpegQualityLevel, AntiAlias, TransparentBackground, PngIncludeDpiMetadata, ThumbnailSize, ScaleX, ScaleY Image (base64)
GetLabelAsPdf Data or XmlTemplate, DataSource?, Dpi, PdfAuthor, PdfProducer, PdfCreator, PdfSubject, PdfTitle, PdfUseVectorDrawing PDF (base64)
GetPrinterCommands Data or XmlTemplate, PrinterLang, PrintOrientation, Copies, Replicates, Dpi, DataSource? Printer commands text
Expressions – JSON array of supported expressions
GetI18NResourceKey ResKey Localized string (e.g. VisualEditorDuplexFrontSide, VisualEditorDuplexBackSide, VisualEditorDuplexFlipPage)

DataSource is sent as "<format>:<base64 of the data>". Label data is always normalized before leaving the browser: view rotation is undone, tray items are placed at 0,0 and duplex labels carry their combined width.


Known gotchas

  • Composite value getters return copies. ThermalLabel.margin, ThermalLabel.sheet_labels_margin, TextItem.border_thickness / corner_radius / text_padding, BarcodeItem.barcode_padding / quiet_zone and RectangleShapeItem.corner_radius return a new object each time. This does nothing: js label.margin.left = 0.2; // modifies a temporary copy Assign a whole object instead: js label.margin = new Printing.FrameThickness(0.2, 0.1, 0.2, 0.1); // left, top, right, bottom
  • Set unit_type before the sizes. ThermalLabel.unit_type first, then width/height, then items.
  • Refresh after code changes. Item setters do not repaint. Call editor.updateSelectionItemsProperties() (selected item) or item.refresh(), then editor.saveCurrentLabelCanvasState() for an undo step. Mutating a Font that is already assigned does not notify the item either.
  • Use addItem instead of label.items.push. Only addItem places the item on the design surface.
  • rotation_angle ranges. Text, image, rectangle and ellipse items throw RangeError outside 0–360. Barcodes, tables and repeaters round to multiples of 90; native printer fonts are also kept at 90° steps.
  • Single editor per page. Theme variables, rulers and in-place editing locate elements by id, so use one editor instance per page.
  • Container is a selector string. new ThermalLabelEditor("#id"); DOM elements are not accepted.
Back to top Copyright © 2003- Neodynamic SRL
http://www.neodynamic.com