remarks icon indicating copy to clipboard operation
remarks copied to clipboard

Extracting annotated PDFs from `rmapi`

Open dcalacci opened this issue 3 years ago • 0 comments

Hi, thank you so much for working on this project!

I am using a new Remarkable 2 with the rmapi toolchain to get PDFs and docs from my device. I expected to be able to run:

rmapi get Document # get document from remarkable
unzip Document.zip -d document #unzip into `document` dir
python -m remarks document output --combined_pdf #export to combined pdf in `output` dir

But because the current rmapi get command does not export the metadata file for the document, remarks fails with no error (but creates the output directory). here's the output of unzipping the rmapi get zip file.

Archive:  Document.zip
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd.content  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd.pagedata  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd/0.rm  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd/0-metadata.json  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd/1.rm  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd/1-metadata.json  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd/2.rm  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd/2-metadata.json  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd.highlights/9cc49bf2-0e47-4e0a-8c4b-2cfb45362def.json  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd.highlights/164af9e1-0b5b-444d-95fe-b22732563d10.json  
  inflating: f547ab4e-23aa-420a-83ae-1de02555d6fd.pdf  

If I look up a document ID using rmapi stat, and manually copy the files matching that ID from my remarkable desktop app library directory, then run remarks, the export works perfectly.

I imagine this might be something I should bring up with the rmapi devs, but wanted to flag it here in case someone else has the same issue, and in case someone here can point me in the right direction!

dcalacci avatar Jun 22 '21 18:06 dcalacci