[NEW PLUGIN] Pdf Viewer

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

simpleSolutions.dk
Posts: 131
Joined: Thu Oct 06, 2011 7:00 am

[NEW PLUGIN] Pdf Viewer

Postby simpleSolutions.dk » Thu Dec 08, 2016 4:13 pm

Pdf Viewer is an implementation of the javascript based pdf.js project for CMSimple and can show an unlimited number of viewers on the same page. Pdf Viewer has options to bypass browser cache and to periodicaly refresh pages running this plugin.
Download: http://simplesolutions.dk/?PDF_Viewer

cmb
Posts: 11140
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Postby cmb » Thu Dec 08, 2016 5:55 pm

Cool! I wasn't even aware of pdf.js – pretty nice! :)

Minor issue: the disclaimer says:
We will not assume any liability in case of data losses caused by News Rotator usage.

That should probably be:
We will not assume any liability in case of data losses caused by PDF Viewer usage.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

Tata
Posts: 2316
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Postby Tata » Thu Dec 08, 2016 10:32 pm

Hi, how is it? Does it work with you? Oldnema wrote me that it doesn't work on his testpage. I made the installation and tried it, following instructions and thing is:
1. files are saved in /userfiles/downloads
2. the command placed on the page.
3. The viewer window is shown nice, but no file is loaded.
4. The "tmp" directory under /userfiles/downloads is created and copies with numeric names are created as well.
5. The viewer returns "Missing file", however.
6. Opening "More information" it says: PDF.js v1.4.20 (build: b15f335)
Message: Missing PDF "http://localhost:8888/userfiles/downloads/BANNERY.pdf".


I'll try it online and report soon back.
EDIT:
Online it works fine. What to do, to have it working on localhost?
Another question: how about include the preview in wdir_XH or download_control or any of download plugins? Maybe only some call of this plugin? Or a link with hi_fancybox or redirect the viewer into a lightbox?
I tried it with a link to the document. But this offers either the download or opening in any preferred application. How could be the plugin function be included into the link?
Something like

Code: Select all

<a href="?&pdfpreview("filename.pdf")... class="zoom_i">whatever</a>
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

simpleSolutions.dk
Posts: 131
Joined: Thu Oct 06, 2011 7:00 am

Re: [NEW PLUGIN] Pdf Viewer

Postby simpleSolutions.dk » Fri Dec 09, 2016 12:20 pm

Christoph
Thx, it's now corrected.

Tata
I didn't test it on localhost.
pdf.js is complex so I just tailored it to my needs right now.
ad 4. temp directory is only created when cache is on.

Tata
Posts: 2316
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Postby Tata » Fri Dec 09, 2016 12:33 pm

simpleSolutions.dk wrote:ad 4. temp directory is only created when cache is on.

The directory is created. Thats not a problem. The problem is that one of the files is reported as not found. See here http://nobela.cmsimple.sk/?Documents/Po ... ovan%C3%A9
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 11140
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Postby cmb » Fri Dec 09, 2016 1:22 pm

Tata wrote:Opening "More information" it says: PDF.js v1.4.20 (build: b15f335)
Message: Missing PDF "http://localhost:8888/userfiles/downloads/BANNERY.pdf".

I'm having the same issue with a local installation which is in a subfolder of the docroot, i.e. I have to access it by http://localhost/xh167. In this case the PDF can't be found. The following change to plugins/pdfviewer/index.php line 67 solved the issue for me:

Code: Select all

    $o.='<iframe id="'.$id.'" src ="'.$pth['folder']['plugins'].'pdfviewer/libs/web/viewer.html?file='.$GLOBALS['sn'].'/userfiles/downloads/'.($srctmp).'#zoom='.$plugin_cf['pdfviewer']['zoom'].'&pagemode='.$plugin_cf['pdfviewer']['pagemode'].'&page='.$plugin_cf['pdfviewer']['page'].'"  allowfullscreen webkitallowfullscreen></iframe>';
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

cmb
Posts: 11140
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Postby cmb » Fri Dec 09, 2016 1:28 pm

Tata wrote:
simpleSolutions.dk wrote:ad 4. temp directory is only created when cache is on.

The directory is created. Thats not a problem. The problem is that one of the files is reported as not found. See here http://nobela.cmsimple.sk/?Documents/Po ... ovan%C3%A9

It appears that http://nobela.cmsimple.sk/userfiles/downloads/Primarne%20umelecke%20vzdelavanie%20ISCED%201b.pdf does not exist (or is not accessible). Did you perhaps misspell the filename?
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

Tata
Posts: 2316
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Postby Tata » Fri Dec 09, 2016 2:56 pm

cmba wrote:whttp://nobela.cmsimple.sk/userfiles/downloads/Primarne%20umelecke%20vzdelavanie%20ISCED%201b.pdf does not exist (or is not accessible). Did you perhaps misspell the filename?
It is coppied from the browser. Anyway, you can find it under Docúents on the second subpage.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 11140
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Postby cmb » Fri Dec 09, 2016 3:03 pm

Tata wrote:It is coppied from the browser.

Hm, but http://nobela.cmsimple.sk/userfiles/downloads/Primarne%20umelecke%20vzdelavanie%20ISCED%201b.pdf says 404 Not found. :?
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+



Return to “Addons and Plugins”

Who is online

Users browsing this forum: No registered users and 3 guests