Loading...
 

As of Tiki19, ViewerJS, which includes WebODF, will no longer be supported because no significant work has been done since 2015


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

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


2. Unzip content on Tiki installation

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


3. Fix folder name

Copy to clipboard
mv /var/www/html/files/viewerjs-0.5.8 \ /var/www/html/files/viewerjs


4. Remove uneeded zip file

Copy to clipboard
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

Copy to clipboard
eval $(sed -n '/^\$/s/^\$//p' /var/www/html/db/local.php)


2. Setup new preferences

Copy to clipboard
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:


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

doc.tiki.org

Get Started

Admin Guide User Guide

Keywords

Keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):

Accessibility (WAI and 508)
Accounting
Articles and Submissions
Backlinks
Banners
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Link Cache
Calendar
Category
Chat
Clean URLs
Comments
Communication Center
Compression (gzip)
Contacts (Address Book)
Contact us
Content Templates
Contribution
Cookie
Copyright
Credit
Custom Home and Group Home Page
Date and Time
Debugger Console
Directory of hyperlinks
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
Draw
Dynamic Content
Dynamic Variable
External Authentication
FAQ
Featured links
File Gallery
Forum
Friendship Network (Community)
Gmap Google maps
Groups
Hotword
HTML Page
i18n (Multilingual, l10n)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
Kaltura video management
Karma
Live Support
Login
Logs (system & action)
Look and Feel
Mail-in
Map with Mapserver
Menu
Meta Elements
Mobile Tiki and Voice Tiki
Module
MultiTiki
MyTiki
Newsletter
Notepad
Payment
Performance Speed / Load
Permissions
Platform independence (Linux-Apache, Windows/IIS, Mac, BSD)
Polls
Profiles
Profile Manager
Report
Toolbar
Quiz
Rating
Feeds
Score
Search engine optimization
Search
Search and Replace
Security
Semantic links
Shadowbox
Shadow Layers
Share
Shopping cart
Shoutbox
Slideshow
Smiley
Social Networks
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Stats
Surveys
Tags
Task
Tell a Friend, alert + Social Bookmarking
TikiTests
Theme CSS & Smarty
Tiki Manager
Trackers
Transitions
User Administration including registration and banning
User Files
User Menu
Watch
WebDAV
Webmail
Web Services
Wiki History, page rename, etc
Wiki Syntax
Wiki structure (book and table of content)
Workspace
WSOD
WYSIWYCA
WYSIWYG
XMLRPC

Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki