ax3l / lines-are-beautiful

C++ File API for the reMarkable tablet
GNU General Public License v3.0
99 stars 9 forks source link

New 1.8 .rm format #23

Open Evidlo opened 5 years ago

Evidlo commented 5 years ago

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.

ax3l commented 5 years ago

Thanks for the heads-up! Do you (or anybody else) want to update the .rm file handling and add some meta-data support for the JSON files (r/w)?

I would propose to use nlohmann/json for this #19.

gitbock commented 4 years ago

Same for me. Was looking forward to use the tool. Compiled fine on my aarch64. Then I realized that it will not read the notebook because of the uuid names :(

Isn't it possible to do give the entire filename on command line and let the page be converted?

lines2png 65e1da44-f3e7-4af5-8273-76b17a551172/107cbcaa-33fe-4c3c-b683-42af27fef6db.rm

Running 2.0.2.0 on my remarkable.

ax3l commented 4 years ago

I currently don't have time for the meta-data update that is needed here, but PRs are very welcome.

attie commented 2 years ago

Just to follow on here, it seems that as of firmware v2.14.1.866 (or possibly before), these files are now version 5, so simply accessing according to the JSON isn't enough, and there may be more significant changes to consider... 😢 Happy to provide a full set of files on request.

00000000: 7265 4d61 726b 6162 6c65 202e 6c69 6e65  reMarkable .line
00000010: 7320 6669 6c65 2c20 7665 7273 696f 6e3d  s file, version=
00000020: 3520 2020 2020 2020 2020 2001 0000 0007  5          .....
00000030: 0000 000f 0000 0000 0000 0000 0000 0000  ................
00000040: 0008 4000 0000 002d 0000 00c9 50d5 43ca  ..@....-....P.C.
00000050: dd55 445b 415c 3f64 819c 40e3 388e 4000  .UD[A\?d..@.8.@.
...

Unfortunately I don't have the time to get into this right now, but I'll keep it in mind - I've only just got my RM2 and was hopeful this would work!