Skip to main content
Supernote devices are e-ink devices. With sn-plugin-lib later than 0.1.65, the coordinates a plugin reads from and writes to the SDK use a single system: Android pixel coordinates, based on the actual page size.
sn-plugin-lib 0.1.65 and earlier return EMR (electromagnetic digitizer) coordinates. Later versions return Android pixel coordinates only. The host decides which one to return based on the sn-plugin-lib version the plugin uses, not on the device system version.

Android Coordinate System

Definition
  • The unit is pixels (px).
  • Conventionally, top-left is the origin: x increases to the right, y increases downward.
  • width/height represent the pixel dimensions of the page (e.g., A5X often uses 1404×1872, Manta often uses 1920×2560).
Where It Applies
  • Stroke sample points (points in Stroke) and five-star points
  • The lasso rectangle and lasso element points. See Lasso
  • Positions and regions of geometry, links, titles, text boxes, and similar elements
You do not need to convert these coordinates to EMR. You can use them directly to draw and position React Native views, and compare them directly across APIs.

Use the Actual Page Size

Every coordinate you pass to the SDK, and every coordinate you get back, is based on the actual page size. Get that size with PluginFileAPI.getPageSize, which returns { width, height }. Coordinates should fall within 0..width and 0..height, regardless of the size shown on screen.
When you operate on the current page, the actual page size from getPageSize is still the baseline. Use getCurrentFilePath and getCurrentPageNum to get the current file path and page number, then call getPageSize.

EMR Coordinate System (Older Versions)

EMR coordinates are used only in sn-plugin-lib 0.1.65 and earlier. Converting between EMR and Android coordinates is tedious, so later versions no longer let plugins read or write EMR coordinates. The SDK APIs perform all conversions internally. Plugins pass in and get back Android pixel coordinates only, and do not need to convert anything themselves. This section is kept so you know what EMR is when you read older plugins or older docs.
EMR (Electro-Magnetic Resonance) coordinates, also called digitizer coordinates, are defined at the hardware level by the EMR handwriting system. They describe the absolute position of the pen tip on the sensing surface. Definition
  • The unit is not pixels, but the digitizer’s hardware coordinate unit (you can think of it as a finer grid).
  • It is typically higher precision: one screen pixel may correspond to multiple EMR units.
  • Axes and origin may differ from screen coordinates (varies by device and orientation), so conversion is required.
Characteristics
  • Not equivalent to UI pixels: you cannot use EMR values as px for layout directly.
Differences from Android Pixel Coordinates In older versions, use PointUtils to convert between EMR and pixel coordinates.

Compatibility APIs for Older Versions

The following APIs are kept only for plugins that use sn-plugin-lib 0.1.65 or earlier. With later versions, avoid using them:
  • androidPoint2Emr / emrPoint2Android in PointUtils: convert between EMR and pixel coordinates
  • getPageDisplaySize: get the display size of the current page
  • maxX / maxY on Element: maximum values in EMR units
After you upgrade sn-plugin-lib to a version later than 0.1.65, remove any PointUtils conversion. The SDK already returns and accepts Android pixel coordinates, so converting again produces wrong positions.