Closed agurvich closed 3 years ago
IRCC the annotations are stored in a separate annotations file (rmlines). You'd need to figure out a way to flatten those annotations into the PDFs (in AppsScript) or perhaps upload them back alongside the original PDF. My memory is a bit hazy as haven't really looked at it recently.
Ah yeah, that makes sense. Downloading off the RM cloud by hand through their app definitely seems to have a processing step, I'll fire up an ssh and explore a bit. Thanks for the tip!
@agurvich I have forked this repo to implement this exact functionality. :)
As @bsdz mentioned, downloaded blob from ReMarkable will be a zip file with pdf + rmlines.
For my purposes I manually run this colab script (based on RMRL) when I want to convert a .bin
file to annotated .pdf
. You could probably setup an automated GDrive integration if the zip -> pdf
conversion is something you intend to do frequently.
Ah wow! I'm so glad I asked then before sitting down to do it. I'll take a look at your fork then and probably raise an issue there if I run into any trouble, thank you for sharing!
@tkukurin , seems like your fork doesn't have issues enabled (also seems like they are disabled by default, weird). Not sure if you want to enable that in the settings and we can take the conversation there but I have bumped into something I can't get past :(
Drive
was. In:
let cache = {};
let cList = JSON.parse(gdFile.getBlob().getDataAsString());
for (var doc of cList) {
cache[doc.ID] = doc;
}
return cache;
}
gdFile.getBlob()
is raising an error because the gdFile
object is missing the getBlob
method. The weird thing is that it works when you use it in the constructor but when the script tries to update the cache after downloading something from the remarkable cloud it comes back with some other gdFile
that has a whole bunch of methods related to setting the metadata (way more methods even than the working gdFile
object has) but nothing about accessing the content (and certainly no getBlob
method). Any idea what could be going wrong?
Here's the callstack of the of the failed getBlob
call:
And here's just a subset of the methods this gdFile
object has related to the metadata
.
It does say it's a json, that it has the right name, etc... it's just missing the getBlob
method 🙁
@agurvich Thanks for letting me know. The GitHub repo is not perfectly in sync with my GDrive implementation, so that's likely the culprit of this error -- I've updated code on my master branch, would you mind checking if things work for you now?
P.S. I've enabled issues on my forked repo so feel free to submit there in case of any problems.
Just taking a look so far, but this looks really awesome! Thanks for putting in the time!
I was wondering if you agreed it would be straightforward to add a download block like your upload block that would push changes on the remarkable to Google drive. For my use case, I'd like to annotate PDFs and then have them synced to Google drive (which is then synced with another service). It seems like a lot of the pieces are here like: crawling the remarkable to find files that aren't in the drive and checking metadata for version updates.
It even seems like you have an open PR to download API. Curious before I sit down and dig in if there's something I'm missing here that makes it harder than it seems?
Cheers.