Loading...
 
Skip to main content

Features / Usability


Trying to install PDF.js

Hi all, I'm trying (unsuccessfully) to install pdf.jsQuestion to enable in-browser viewing of pdf files in a separate tab/window, like countless sites on the web can do. This is a crucial feature for me.

Status;
- Tiki v19.1 installed with php 7.2
- pdf.js unzipped to /addons folder in Tiki instance
- Confirmed composer is installed, run setup.sh successfully
- composer.json file is present in root
- followed instructions hereQuestion by running php console.php addon:install pdfjs-2.0.943-dist (being the latest stable version) from Tiki root folder using shell
- result is No profiles found with red background 😑

Image

I also tried checking that the db is updated, and it is.

I'd really appreciate any advice and suggestions. I'm not a coder, and am building a Tiki demo for use in the trade association for which I work. We're heavy users of PDFs, and without this feature working I unfortunately can't use Tiki.

Thank you in advance!

I have Tiki 19.1 installed, and a PDF files saved in a file gallery opens already automatically in a new browser tab. So there is no need to install anything.

Otherwise you could try to change TikiRoot\tiki-download_file.php

Copy to clipboard
if (! $content_changed and ! isset($_GET['display'])) {

Replace by:

Copy to clipboard
if (! $content_changed and ! isset($_GET['display']) and $info['filetype'] != 'application/pdf' ) {


Btw, go the tab 'Packages' in Control panels to install extra packages ( I don't think the way you subscribe is the way to install extra functionality)


Thank you Wiebe. Last year I'd been trying to do this with Tiki 18.3 and it would only download the pdf, not enable in-browser viewing. I only returned to Tiki when I found the document about pdf-js viewer for v19, and followed instructions thereon. Hence the complex process which I noted, including manual packages install. Turns out it's unnecessary.

So I just tried an in-line file placement as you suggested and see there is now an option for opening in browser. Excellent! I should've tried that first. I appreciate you taking the time to respond.

Dave