[Cubicweb] Preview with ViewerJS in CW
celso.flores at crealibre.com
Wed Mar 30 01:45:58 CEST 2016
Hi, I am myself back this week to CW, for a proposal on a small project
using PDFs as a Document Management App.
My starting structure :
Cube : ClientName
Cube : Design ( Putting some colors on Bootstrap, not client related )
Cube : FileManager, including file and Squareui ( and folder and tag on the
I am not sure if we should rather put some work on file and folders primary
views from those cubes, that could benefit more people (as long as views
are somehow community validated). The question really is if we want a more
ready to use cubes, or keep them simple as they are today.
ViewerJS was certainly my first choice for PDF HTML Internal views,
nevertheless, clients at this project only needed to use some download
button ( with basic <a href download>
<http://www.w3schools.com/tags/att_a_download.asp> tag) and a preview
button that opens the document in another tab (HTML's "a" tag without
download option in modern browsers).
So I will love to see what will be the best option to integrate ViewerJS,
as it could be pretty useful with document using the Open Document Format.
Sorry, I could not help on the technical implementation, being myself still
learning on Python, CubicWeb, and related Web technologies.
On Mon, Mar 28, 2016 at 11:01 PM, Stéphane Bugat <stephane.bugat at free.fr>
> Hi World!
> Back (and glad to be back) in CW community for another project!
> This today's issue: how to preview some files (like PDFs) in a CW view
> using ViewerJS?
> As far as I understood: the usual way to use ViewerJS is to install it on
> the server side, and add "ViewerJS/../#" to the base of the URL of the file
> that has to be previewed.
> However, in CW, downloadable URL's for files do not correspond to an
> actual "place" on the server, and this seems to fail with a kind of "bad
> resource location".
> So my question is: is there a 'simple' other way to deal with it? I saw
> that there is for instance a cache mechanism for thumbnail images that
> could be templated for that... But I don't know if this is the right way to
> do it, and moreover I'm still wondering if this does not create permission
> Cubicweb mailing list
> Cubicweb at lists.cubicweb.org
Knowledge Management Consultant
Mx. Celular - 55 25 07 21 60
celso.flores at crealibre.com about.me/celsoflores
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cubicweb