[Cubicweb] Preview with ViewerJS in CW

St├ęphane Bugat stephane.bugat at free.fr
Mon Apr 4 19:25:17 CEST 2016


Hi Celso, hi Christophe

> Having spend a little time this weekend on ViewerJS, i found as you 
> did that :
>
> 1. Putting your VJS in data and running your instance, we can 
> hopefully see the empty document viewer at (your instance path) 
> *data/ViewerJS/index.html*//
> /
> /
/Agree./
>
> 2. To see a document in a View using VJS, I only managed to make it 
> work on PDFs using this code:
>
>         testpdf = "data/ViewerJS/../test1.pdf"
>         frame = (u'<iframe src = "%s" width="400" height="300" '
>                  u'allowfullscreen webkitallowfullscreen></iframe>' % 
> testpdf)
>         self.w(frame)
>
>
> Remarks:
> 2.a We can see two documents PDF open at the same view, opening one 
> frame for each, and using the same ViewerJS obviously.
>
The same happens to me.
> 2.b As soon as I change the pdf for a Text document, spreadsheet or 
> presentation using LibreOffice, then the document is downloaded, while 
> uploading the view.
> So this code :
>
>         testdoc = "data/ViewerJS/../text.odt"
>         frame = (u'<iframe src = "%s" width="400" height="300" '
>                  u'allowfullscreen webkitallowfullscreen></iframe>' % 
> testdoc)
>         self.w(frame)
>
> Will download the file to your system (that happens at least on my 
> CW's local instance)
>
Yes also.
>
> I guess we should have some "viewable" view for pdfs, besides the 
> idownlodable, raw format.
>
> Probably there is and I just could not find it.
>
I guess we should, definitely.
> -------
>
> I will certainly continue on this later this week.
>
Thank you for joining this small ViewerJS community!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20160404/ab3e0e1a/attachment-0186.html>


More information about the Cubicweb mailing list