[Cubicweb] Preview with ViewerJS in CW

St├ęphane Bugat stephane.bugat at free.fr
Tue Mar 29 07:01:05 CEST 2016

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 issues?


More information about the Cubicweb mailing list