Skip to content

twangodev/sdocx

Repository files navigation

sdocx

CI crates.io (sdocx) npm docs.rs License

Reverse-engineered tooling and SDK for converting Samsung Notes (.sdocx) files.

Installation

CLI

cargo install sdocx-cli

Library

cargo add sdocx

npm (WASM)

npm install @twango/sdocx

Docker

docker pull ghcr.io/twangodev/sdocx

CLI Usage

sdocx-cli samples/handwritten.sdocx
Page dimensions: 1848 x 7838
Background: #252525
1 page(s)
  Page 0: 1848 x 7838, 2769 strokes, 321776 points, 3 colors, 2769 with pressure

With Docker:

docker run --rm -v "$(pwd)":/data ghcr.io/twangodev/sdocx /data/samples/handwritten.sdocx

Library Usage

use sdocx::parse;

fn main() -> sdocx::Result<()> {
    let doc = parse("notes.sdocx")?;

    println!("{} page(s)", doc.pages.len());

    for page in &doc.pages {
        for stroke in &page.strokes {
            println!(
                "Stroke: {} points, color {:?}, width {}",
                stroke.points.len(),
                stroke.color,
                stroke.pen_width
            );
            for point in &stroke.points {
                println!("  ({}, {})", point.x, point.y);
            }
        }
    }

    Ok(())
}

JavaScript Usage

import init, { parse } from "@twango/sdocx";

await init();

const bytes = new Uint8Array(await file.arrayBuffer());
const doc = parse(bytes);

for (const page of doc.pages) {
  for (const stroke of page.strokes) {
    console.log(`${stroke.points.length} points, color:`, stroke.color);
  }
}

Format Documentation

Samsung Notes .sdocx files are ZIP archives containing binary stroke data, metadata, and page definitions. The notebooks/ directory contains Jupyter notebooks that document the reverse-engineering process:

License

GPL-3.0

About

Reverse-engineered tooling and SDK for converting Samsung Notes (.sdocx) files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors