Add save and load regions (via browser console)#669
Conversation
|
@cheapsteak Whoa, this is awesome! Building the ability to save and load templates has been on the wish list for AGES. (see #483, #93). We'll take a look at your PR; this is a great start. |
|
Initially I had imagined saving templates to disk and then re-uploading them. But your idea of saving the template to localStorage is a brilliant one, since I think it'll remove a few steps from the workflow. (Occasionally I can envision wanting to download a template and either save it for later or email it to someone, so we'll want the download/upload workflow. But probably the vast majority of users will want to save a template and use it again a minute later; for that, the localStorage method would work great.) |
|
happy to hear it'll help :) a quick solution to enabling downloading a saved state as a file would be to run this in the console window.location.href = window.encodeURI('data:application/download;charset=utf-8,' + Tabula.pdf_view.serializeSelections());that should trigger a download then to load it, Tabula.pdf_view.loadSerializedSelections(JSON.parse("string contents of the file that was previously downloaded (it's a json file)")) |
|
Awesome. I will take a look and try to figure out how to fit this in. Not sure when I'll get to it, but it's on my todo list. |
No UI (should be the easy part, hacked this in to scratch an itch)
In browser console:
Saves to localStorage
Should also be trivial to export save-files from the JSON in localStorage