ax3l / lines-are-beautiful Goto Github PK
View Code? Open in Web Editor NEWC++ File API for the reMarkable tablet
License: GNU General Public License v3.0
C++ File API for the reMarkable tablet
License: GNU General Public License v3.0
Add python bindings with pybind11.
Add GCC 4.8 builds to travis.
Reorder the pages in a notebook.
Read and write the JSON meta data and store it in our objects.
Per notebook:
UUID.content
: orientation, pageCount, ...UUID.metadata
: deleted, lastModified, metadatamodified, modified, pinned, synced, type, version, visibleNameUUID.pagedata
: N lines with name of background (not a JSON)Per page (missing in example):
UUID/<N>-metadata.json
{
"layers": [
{
"name": "Layer 1"
}
]
}
(also sometimes an empty string: "name": ""
)
We will use nlohmann/json as in-code dependency.
The reMarkable tablet itself and most desktops are little endian, and so is the .lines
format.
Accordingly, we will have to swap the bit order during read/write operations from/to little endian when compiling/running on a big endian platform, such as PPC.
Refs:
In the structs, count-members are ill-designed and can be outdated when the containers get updated (npages
, nlayers
, etc.).
Instead, use local vars during read and access .size()
of the container when needed from the struct.
In an effort to make projects for the reMarkable tablet easier to find on GitHub, a common topic named remarkable-tablet
has been established (See reHackable/awesome-reMarkable#1).
It would be awesome if you could tag this project with the remarkable-tablet
topic.
There's more info on Classifying your repository with topics available in the GitHub help.
A list of already tagged projects can be found here: Projects in Topic remarkable-tablet.
As of update 1.8, the .rm files are in a new format.
It looks like instead of each file being indexed by the page number, the pages are now assigned a random UUID.
[root@remarkable 6b96d778-b6f5-458e-9b7d-649689706f37] ls
012f4a15-8cdb-4d44-aa02-05fd911873e6-metadata.json
012f4a15-8cdb-4d44-aa02-05fd911873e6.rm
0fe5e46a-51c1-4255-a062-c1333dd7eac9-metadata.json
0fe5e46a-51c1-4255-a062-c1333dd7eac9.rm
52d23c5a-9e79-46cd-9aca-560cf572cddf-metadata.json
52d23c5a-9e79-46cd-9aca-560cf572cddf.rm
564b27fd-8ad0-44f1-a041-6a5e022a131d-metadata.json
564b27fd-8ad0-44f1-a041-6a5e022a131d.rm
57791cbe-8297-41c8-8a0b-98a4eb4bf271-metadata.json
57791cbe-8297-41c8-8a0b-98a4eb4bf271.rm
dec625e0-8c4a-4cba-8143-bf8c8b9b0d86-metadata.json
dec625e0-8c4a-4cba-8143-bf8c8b9b0d86.rm
Additionally, the accompanying .json files contain layer information:
[root@remarkable 6b96d778-b6f5-458e-9b7d-649689706f37] cat 012f4a15-8cdb-4d44-aa02-05fd911873e6-metadata.json
{
"layers": [
{
"name": "Layer 1"
}
]
}
Page order can be inferred from the .content file
[root@remarkable 6b96d778-b6f5-458e-9b7d-649689706f37] cat ../6b96d778-b6f5-458e-9b7d-649689706f37.content
{
"extraMetadata": {
"LastBrushColor": "Black",
"LastBrushThicknessScale": "2",
"LastColor": "Black",
"LastEraserThicknessScale": "2",
"LastEraserTool": "Eraser",
"LastPen": "Ballpointv2",
"LastPenColor": "Black",
"LastPenThicknessScale": "2",
"LastPencil": "SharpPencilv2",
"LastPencilColor": "Black",
"LastPencilThicknessScale": "2",
"LastTool": "Ballpointv2",
"ThicknessScale": "2"
},
"fileType": "pdf",
"fontName": "",
"lastOpenedPage": 0,
"legacyEpub": false,
"lineHeight": -1,
"margins": 100,
"orientation": "portrait",
"pageCount": 11,
"pages": [
"00dd2a52-3057-4fac-8438-d7177a631df0",
"dec625e0-8c4a-4cba-8143-bf8c8b9b0d86",
"52d23c5a-9e79-46cd-9aca-560cf572cddf",
"012f4a15-8cdb-4d44-aa02-05fd911873e6",
"564b27fd-8ad0-44f1-a041-6a5e022a131d",
"57791cbe-8297-41c8-8a0b-98a4eb4bf271",
"0fe5e46a-51c1-4255-a062-c1333dd7eac9",
"ed1694c3-b67a-450d-bb45-e4691c5cc75f",
"351c255b-3350-4771-b6cc-b02625c1a6d5",
"41259360-ba5d-45d2-9fe6-57434f79950b",
"9399bb75-310a-4d31-8961-5f26b6f85500"
],
"textScale": 1,
"transform": {
"m11": 1,
"m12": 0,
"m13": 0,
"m21": 0,
"m22": 1,
"m23": 0,
"m31": 0,
"m32": 0,
"m33": 1
}
}
Only pages that have been annotated have .rm files.
Allow to write a Notebook
class again.
The file format was updated to v3. Investigate the changes.
I've been considering if it would be feasible to convert an SVG back to the native remarkable file format, so that existing paper notes could be digitized as native notebooks on the remarkable (and support all the existing features).
This project looks like the best home for such a tool, but I wanted to gather your opinion on if it would be at all feasible. The first problem I can think of is that there are a lot of elements in the SVG format that would not neatly map to anything the remarkable supports. However I wonder if a simplified case (using only paths) might be workable for written documents.
Splitting pages out of a notebook is a feature I am desperately missing in the original GUI. Also the opposite, merging, could be useful.
Add an Alias with namespace inside the main CMakeLists.txt
so the project can be imported in-source, "like a header-only lib".
Hi, your library is awesome and I have tried to port it to C# to use it on my project. Loading works fine but exporting to svg does not work. there are random line and not what should it be.
The Implementation: https://github.com/furesoft/Slithin/blob/main/Source/Core/Remarkable/LinesAreBeatiful/Exporters/SvgExporter.cs
Did I have a mistake there?
By looking at this code: https://github.com/NateScarlet/svg-variable-width-line
I was wondering if it would be possible to do the same.
Their algorithm is not too hard to grasp, they consider a stroke (in the rM meaning) to be a path by itself that's not stroked (by the SVG meaning). So a stroke will be converted to a closed polygon/curve (that'll be pseudo rectangle, and larger where the stroke is larger and smaller when the stroke is lighter). The implementation of their algorithm is done by maintaining the main path (like you did) and, when rendering:
Some test might be required to find out the ratio width/pressure to match what rM is drawing and what to do on self intersecting path.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.