Loading...
 
Skip to main content

Features / Usability


PDF viewer and ensuing issues with Packages and tiki-check

posts: 11 United Kingdom

Hi,
I want to display a PDF file from the file gallery in a Wiki page, without the ability to download it or print it off - this doesn't need to be super secure, just not obvious to people who aren't very computer literate.

WebDocViewer with webdocviewer url="https://tim-thornton.com/tikiwiki/tiki-download_file.php?fileId=375" width="750" height="780" ({} omitted as otherwise it messes up posting here) shows the PDF, but if the user clicks on the pop-out button in the top right the print and download options are there - is there a way to disable these?

I tried using MediaPlayer which requires enabling PDF,js so I went to Control Panels -> File Galleries -> Enhancements to enable it, but then got the message Missing tiki package: npm-asset/pdfjs-dist-viewer-min
So I tried going to Control Panels -> Packages to add this in, but the Packages window doesn't come up, and eventually I get an HTML Error 500
No idea if the installation has always been like this or if it's something new, but to try and diagnose it I went to Control Panels -> General and clicked on Server Fitness to run tiki-check.php. This didn't run - I know I've run it in the past but haven't knowingly changed anything to block it - I'm not a proficient Linux user, and generally just do all I need from within TikiWiki, generally just editing content. I also went into Security Admin and ran Check all tiki files and Check file permissions, but neither showed anything amiss as far as I could see.

Using an Iframe as IFRAME(src="https://tim-thornton.com/tikiwiki/tiki-download_file.php?fileId=375" width="600" height="500" scrolling="auto") IFRAME opens up the PDF in a new tab rather than embedding it in the page, and the web browser's print and download controls are there. If I add in sandbox="allow-scripts allow-same-origin" this doesn't disable print and download functions, which it does in normal HTML

Using HTML as HTML()=embed src="https://tim-thornton.com/tikiwiki/tiki-download_file.php?fileId=375" width="750" height="780"= =/embed=HTML ( replaced with =) works well using the browser's PDF viewer with the full set of controls.
or using HTML()=iframe src="https://tim-thornton.com/tikiwiki/tiki-download_file.php?fileId=375" sandbox="allow-scripts allow-same-origin"= =/iframe= HTML doesn't disable the print and download functions.

I could embed Yumpu, a PDF file viewer, which will give me what I need, but it would be neater to do it all within TikiWiki, as well as avoiding taking out another subscription!

This is on Tiki 20.1 (yes I know I need to upgrade) on a shared server.

Anyone got any thoughts on the best way of displaying the PDF and/or the Packages and tiki-check not working?

Many thanks,
Tim

There are no comments at this time.