0% found this document useful (0 votes)
93 views

Viewerjs: Install

ViewerJS will no longer be supported in Tiki19 as it has not been updated since 2015. PDF viewing will now use Mozilla's PDF.js library installed via packages. ODF viewing will use code from the Wodo text editor (WebODF) also installed via packages. The document provides instructions for installing and configuring PDF.js and WebODF to replace ViewerJS for file viewing in Tiki.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

Viewerjs: Install

ViewerJS will no longer be supported in Tiki19 as it has not been updated since 2015. PDF viewing will now use Mozilla's PDF.js library installed via packages. ODF viewing will use code from the Wodo text editor (WebODF) also installed via packages. The document provides instructions for installing and configuring PDF.js and WebODF to replace ViewerJS for file viewing in Tiki.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

As of Tiki19, ViewerJS, which includes WebODF, will no longer be supported because no significant

work has been done since 2015

https://github.com/kogmbh/ViewerJS/commits/master

For PDF viewing, we will start using code directly from Mozilla's PDF.js, and installable via Packages.

For ODF viewing, we will start using code directly from the Wodo text editor (WebODF), and installable
via Packages.

ViewerJS
As of Tiki 15.0 (also backported to 14.2 and 12.5 ) support has been added for ViewerJS.

ViewerJS can already natively show both PDF files and many types of Office files stored in OpenDocument
Format, the open standard for office documents. ODF is available by default in almost any modern office
applications such as Microsoft Office, LibreOffice, Apache OpenOffice and Calligra Suite. Because it is built
on modern web technologies, ViewerJS understands embedded fonts, so your documents look pretty
everywhere.

Install
Assuming:

Site address is http://tiki15.docker


Document root path is /var/www/html
Database name is tiki15
For this example we will use PluginMediaPlayer.

Getting and unpacking viewerjs


1. Get viewerjs

curl -o /tmp/viewejs.zip \
https://viewerjs.org/releases/ViewerJS-latest.zip

2. Unzip content on Tiki installation

unzip /tmp/viewejs.zip \
-d /var/www/html/files

3. Fix folder name

mv /var/www/html/files/viewerjs-0.5.8 \
/var/www/html/files/viewerjs
4. Remove uneeded zip file

rm /tmp/viewejs.zip

Setting up Tiki
Remembering, for this example we will use PluginMediaPlayer.

Activate ViewerJS

1. Go to "File Galleries" admin page (http://tiki15.docker/tiki-admin.php?page=fgal)


2. Click on "Enhancements" Tab
3. On "Access" section check the option "Use Viewer JS"
4. Click on "Apply" button

1. Load credentials
eval $(sed -n '/^\$/s/^\$//p' /var/www/html/db/local.php)

2. Setup new preferences

mysql -u$user_tiki -p$pass_tiki -h$host_tiki $dbs_tiki << EOF


INSERT INTO tiki_preferences VALUES
('fgal_viewerjs_feature', 'y')
ON DUPLICATE KEY UPDATE value='y';
INSERT INTO tiki_preferences VALUES
('fgal_viewerjs_uri', 'files/viewerjs/ViewerJS/index.html')
ON DUPLICATE KEY UPDATE value='files/viewerjs/ViewerJS/index.html';
EOF

Adjust Editor toolbar


1. Go to toolbar edit page (http://tiki15.docker/tiki-admin_toolbars.php)
2. On section "Plugin Tools" locate and drag "mediaplayer" to section "Row 1"
3. Click on "Save" button

Usage
You can use ViewerJS through the File Gallery, or through PluginMediaplayer or through PluginIframe, but
remembering, for this example we will use PluginMediaPlayer.

1. Go to File Galleries upload page (http://tiki15.docker/tiki-upload_file.php)


2. Select any PDF you want
3. Click on "Upload" button
4. Write down the file ID (Let's suppose ID is 1)
5. Edit any page you want (eg.: http://tiki15.docker/tiki-editpage.php?page=HomePage)
6. On editor toolbar, click on button with "Play" icon
7. On "URL" field, type "tiki-download_file.php?fileId=1", where 1 is the file ID
8. On "File type" field, type "PDF"
9. Click on "Insert" button
10. After popup closes, click on "Save" button

You should see the PDF inside your page.

Related
Related:

PDF
File Gallery
PluginMediaPlayer
PluginIframe

Collection of References on doc.tiki.org

Print general info about printing


PDF general overview about PDF creation in Tiki
mPDF create PDFs from Tiki content (advanced library that works even on shared hosting).
Recommended for Tiki18+
PluginPDF alter default settings of mPDF per wiki page
PluginPDFPageBreak add a page break for PDFs created with mPDF
PluginMediaPlayer display PDF file from file gallery
PDF.js viewer PDF.js from Mozilla
ViewerJS: a script to view PDFs and ODFs, which bundles WebODF
PluginArchiveBuilder Generate a zip file, including PDFs from wiki pages
WeasyPrint A PDF generation option in Python
wkhtmltopdf create PDFs from Tiki content (needs root installation)
dompdf once used for PDF print of slideshows

You might also like