davros icon indicating copy to clipboard operation
davros copied to clipboard

Preview .odt, .doc, .pages

Open kentonv opened this issue 8 years ago • 9 comments

A user (the same one who wanted PDF support) said it would be nice if .odt and .pages files could also be previewed. Obviously this would be a whole lot more complicated, but I imagine it would be feasible to find some open-source tool that can convert various formats to .pdf for display.

kentonv avatar Mar 02 '16 21:03 kentonv

I think I now have a framework for loading javascript viewers, and .odt should be fairly easy to support. Unfortunately I wasn't able to find a Pages document parser in javascript, but would be happy to incorporate one if it exists. I hold out even less hope for Word documents; all of the viewers I've found are commercial except for one that has a weird "only-run-on-windows" license. (https://github.com/stephen-hardy/DOCX.js)

mnutt avatar Mar 13 '16 23:03 mnutt

Of course there's a lot more software on the backend that could convert, but I'd prefer to keep backend processing to a minimum and I'm hesitant to pull in something like libreoffice due to the size.

mnutt avatar Mar 13 '16 23:03 mnutt

@mnutt Wow, that's some good old "Microsoft classic" licensing.

ocdtrekkie avatar Mar 14 '16 00:03 ocdtrekkie

FWIW libreoffice does have a headless mode that can do conversions:

https://gist.github.com/diogo-almeida/9339203

It would be interesting to find out just how much it bloats the spk.

kentonv avatar Mar 14 '16 04:03 kentonv

What about putting the headless preview generator in its own app? Is that feasible, @kentonv ?

dckc avatar Aug 20 '16 19:08 dckc

I was actually thinking something along those lines too; Davros is never going to be the best music player or slideshow or document editor, etc, but it would be great if it would seamlessly call out to those through powerbox.

mnutt avatar Aug 20 '16 19:08 mnutt

Yeah this is likely to be possible someday. We need to:

  1. Add an API by which an app can request an iframe-embeddable URL for a UiView capability (i.e. a capability to another grain). This will allow embedding grains in each other.
  2. Add an API by which Davros can request the creation of a sub-grain based on a File capability, getting a UiView back. I think a normal powerbox offer isn't really what you want here, because the user probably doesn't want to be asked what app to use every time they preview a file. There's also no security reason to require an explicit choice, because the sub-grain would of course start out sandboxed so couldn't do anything Davros couldn't already do.
  3. Figure out how, exactly, apps register their ability to handle these situations, and how users specify which app to use. This is probably the hardest part.

kentonv avatar Aug 20 '16 21:08 kentonv

I still feel there's a strong value to someday being able to straight upload a file to Sandstorm outside of any particular application, for very generic formats where many apps might be available to view/edit/etc. that file type. Similarly, then, there'd be cause for a type of Sandstorm app which exposes what file formats it knows how to work with.

ocdtrekkie avatar Aug 20 '16 22:08 ocdtrekkie

Long-term, something sandboxed would be great but short-term I am currently looking into using libreoffice to generate previews. I can't promise anything until I actually get it working inside sandstorm, but I'm pretty hopeful.

mnutt avatar Aug 22 '16 22:08 mnutt