{"id":22042734,"url":"https://github.com/akeil/rmtool","last_synced_at":"2025-05-08T01:22:21.720Z","repository":{"id":49000708,"uuid":"326218188","full_name":"akeil/rmtool","owner":"akeil","description":"Tool for interacting with the reMarkable lines format and API","archived":false,"fork":false,"pushed_at":"2021-07-01T12:30:30.000Z","size":387,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T16:10:22.723Z","etag":null,"topics":["remarkable","remarkable-tablet"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akeil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-02T16:03:07.000Z","updated_at":"2025-01-19T15:45:24.000Z","dependencies_parsed_at":"2022-09-08T00:01:03.333Z","dependency_job_id":null,"html_url":"https://github.com/akeil/rmtool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akeil%2Frmtool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akeil%2Frmtool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akeil%2Frmtool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akeil%2Frmtool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akeil","download_url":"https://codeload.github.com/akeil/rmtool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252979608,"owners_count":21835089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["remarkable","remarkable-tablet"],"created_at":"2024-11-30T12:13:22.371Z","updated_at":"2025-05-08T01:22:21.696Z","avatar_url":"https://github.com/akeil.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reMarkable Tools\nTools for working with the [reMarkable](https://remarkable.com/) notes format and API.\n\n**Status:** This is very much *work in progress*.\nThe basic functionality should work but there will be some bugs\nand missing features.\nUse at your own risk ;-)\n\nThis has been tested with the *reMarkable 2* on Linux.\n\n## CLI Tool\nA command line tool is included which serves as a example on how the API works.\nIt should also be useful on its own:\n\n- `ls` lists the content from the device\n- `get` downloads notes as PDF files\n- `put` uploads PDF documents to the device\n- `pin` allows to set or remove bookmarks\n\nThe CLI tool uses the reMarkable cloud API.\n\n## Parser\nThe parser supports the v3 format for reMarkable notes.\n\n## RM Lines Format\nThe `rm` format is the proprietary format used by the\n[reMarkable](https://remarkable.com/) tablet. The format is used to store\ndrawings made on the tablet.\n\nThe format is documented in the unofficial\n[reMarkable Wiki](https://remarkablewiki.com/tech/filesystem#lines_file_format).\n\nIn *version 5*, each `.rm` file contains one page.\nEach page consists of several layers which contain the *strokes* that make up\nthe image.\n\nThe file consists of a simple header followed by the data.\nThe data is structured into layers, strokes and dots.\n\nAll numeric values are **little endian**.\n\n### Header\nThe header length is `43` bytes and contains ASCII encoded text:\n\n    reMarkable .lines file, version=5\n\nThe remaining bytes are filled with whitespace.\n\n### Layer\nThe header is immediately followed by `4 bytes` for a 32 bit unsigned integer\nwhich gives us the number of layers.\n\nThe next `4 bytes` are again a 32 bit unsigned integer for the number of\n*strokes* in the first layer.\n\n### Stroke\nEach stroke consists of the stroke data followed by the data for the dots.\nA stroke has the following attributes:\n\n| Size      | Datatype  | Description         |\n|-----------|-----------|---------------------|\n| `4 bytes` | `uint32`  | Brush Type          |\n| `4 bytes` | `uint32`  | Color               |\n| `4 bytes` | `uint32`  | Padding?            |\n| `4 bytes` | `float32` | Brush Size          |\n| `4 bytes` | -         | *unknown* (v5 only) |\n| `4 bytes` | `uint32`  | Number of Dots      |\n\nThe data for the individual dots follows immediately after.\n\nThe **Brush Types** refer to the different \"pencil\" choices available on the\ntablet. The values are different for the v3 and the v5 format.\n\n| Version | Brush             | ID |\n|---------|-------------------|----|\n| v3      | Paint Brush       | 0  |\n| v3      | Pencil            | 1  |\n| v3      | Ballpoint         | 2  |\n| v3      | Marker            | 3  |\n| v3      | Fineliner         | 4  |\n| v3      | Highlighter       | 5  |\n| v3      | Eraser            | 6  |\n| v3      | Mechanical Pencil | 7  |\n| v3      | Eraser            | 8  |\n|         |                   |    |\n| v5      | Brush             | 12 |\n| v5      | Mechanical Pencil | 13 |\n| v5      | Pencil            | 14 |\n| v5      | Ballpoint         | 15 |\n| v5      | Marker            | 16 |\n| v5      | Fineliner         | 17 |\n| v5      | Highlighter       | 18 |\n\nThe **Color** is either *Black* (`0`), *Gray* (`1`) or *White* (`2`).\n\nThe **Brush Size** is the selected base size of the brush\n(not to be confused with the effective width of the stroke).\nPredefined sizes are *Small* (`1.875`), *Medium* (`2.0`) and *Large* (`2.125`).\n\n### Dot\nEach dot holds the following attributes:\n\n| Size      | Datatype  | Description    |\n|-----------|-----------|----------------|\n| `4 bytes` | `float32` | X-Coordinate   |\n| `4 bytes` | `float32` | Y-Coordinate   |\n| `4 bytes` | `float32` | Speed          |\n| `4 bytes` | `float32` | Tilt           |\n| `4 bytes` | `float32` | Width          |\n| `4 bytes` | `float32` | Pressure       |\n\nAfter the last byte of the dot data is read,\nThe data for the next layer begins, starting with the number of strokes.\n\nThe **Coordinates** range between `0,0` and `1404,1872`,\nthe origin is at the top left corner.\n\n**Speed** is a measure for how fast the stylus is drawn across the surface.\nNot sure how this would affect something (maybe the density of the stroke?).\n\nThe **Pressure** values ranges from `0.0` to `1.0`.\n\nThe **Width** seems to be the effective width of the brush,\nalready accounted for tilt and pressure.\n\n\u003e Not quite sure if this is correct.\n\u003e Depending on the Brush type and size, pressure and tilt should determine\n\u003e the actual width of the stroke.\n\nThe **Tilt** value is the angle of the stylus towards the tablet surface.\nIt is given in radians and ranges in two intervals\nfrom `0.0` to `1.5708` (0 to 90 degrees)\nand from `4.7124` to `6.2832` (270 to 360 degrees).\n\n## Render\nThe `render` package contains methods to render drawings to a bitmap (PNG)\nor PDF.\n\n### Status\nThis \"basically works\" but the rendering output does not quite match the\noriginal.\n\n- Some lines are way to thin/weak, others to strong.\n- When Rendering a drawing as an overlay on an existing PDF,\n  the scale and placement of the drawing is off.\n\n## API\nThe `api` package contains an implementation for the reMarkable cloud API,\nincluding a client for websocket notifications.\n\nIf the tablet is connected to the API, one can access folders and documents\nthrough that API and also upload or modify content.\nChanges made through the API will by synced to the tablet.\n\n---\n\n# Disclaimer\nThis is a personal project.\nIt is **not** associated with the reMarkable company.\n\n---\n\n# Credits\n\nSources:\n\n- https://plasma.ninja/blog/devices/remarkable/binary/format/2017/12/26/reMarkable-lines-file-format.html\n- https://github.com/juruen/rmapi/\n- https://www.reddit.com/r/RemarkableTablet/comments/7c5fh0/work_in_progress_format_of_the_lines_files/\n- https://github.com/splitbrain/ReMarkableAPI/wiki\n- https://gitlab.com/wrobell/remt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakeil%2Frmtool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakeil%2Frmtool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakeil%2Frmtool/lists"}