Loading...
 
Define an archive that can be downloaded

Plugin Archive Builder


Wikis are a great central repository for everyone to access the information. However, when used within the boundaries of an organization, it may be hard to provide only a portion of the information to an external group of people. Although it may be possible through assigning permissions, it still requires to grant them access to the wiki, provide them with accounts and walk them through the process of finding what they need. Just sending them a zip with the information they need might just be easier. This wiki plugin, introduced in Tiki5, does just that. Through arguments, it allows to define the content of an archive. Once rendered, it displays a Download archive button to generate the archive on the fly.

 note

A new option to create PDF's from within Tiki was introduced and available in Tiki16 based on a PHP library that works even on shared hosting without full root access. See mPDF

Requirements

The print as PDF mechanism uses the standard wiki print feature. However, the PDF generation is done through external HTML to PDF tools. These must be enabled and configured. Here are the alternatives. Chose one:

  1. Webkit wkhtmltopdf
    • Download wkhtmltopdf and place the executable somewhere on the host. Make sure it is executable from the web server.
    • Set PDF from URL to Webkit (preference: print_pdf_from_url set to webkit)
    • Set Webkit path to the full path to your executable. For example /home/doc.tiki.org/webkit/wkhtmltopdf.(preference: print_pdf_webkit_path)
  2. Webservice
    • Set PDF from URL to Webservice (preference: print_pdf_from_url set to webservice)
    • Set Webservice URL to the service location. The webservice must take the URL as the query string. A sample PHP script is available below. (preference: print_pdf_webservice_url)

 Note
In version tiki<5.0, these preferences must be set directly in the database (do not forget to clear the cache to see them in tiki)
 Note
You may find these settings under Admin Home (tiki-admin.php), and then in the Configuration search box, enter "pdf" (no quotes). After submitting, you will see "Not Found" next to each setting; ignore that (it is saying that the Admin Panel for that setting cannot be found).
Why is configuration required?

wkhtmltopdf is written in C++ and there are different packages for Windows/Linux/MacOSX and thus it's better to install separately.

Moreover, some servers may not allow shell execution, which is required. This can be worked around by installing it on a different server and accessing it remotely.

Access rights

Because the content of the page is accessed through a URL, access rights must be managed correctly. If permissions protect the page from being visible to anonymous or plugins render it differently for them, an additional feature must be enabled.

The Token Access feature allows the archive builder to generate tokens bound to a specific URL. The PDF generator will then include the token as part of the URL. Doing so will grant the same groups to the PDF generator as the groups used by the archive requester. By default, the token will be available for 30 seconds.

Parameters

Define an archive that can be downloaded
Introduced in Tiki 5. Required parameters are in bold.
Go to the source code
Preferences required: wikiplugin_archivebuilder

Parameters Accepted Values Description Default Since
(body of plugin) Description of the archive content. Multiple handlers are available for content types. One per line. Ex: page-as-pdf:some-folder/foo.pdf:HomePage , tracker-attachments:target-folder/:3435
name Upon download, the name of the file that will be provided. 5.0

Body

The body of the plugin simply contains a list of rules to determine which file to create and where to take the content from. Each line is independent. Arguments are separated by colons. The first argument indicates how to treat the rest of the line. The following tokens may be used:

  • page-as-pdf to take render the content of a page as a pdf.
    • First argument is the name and location of the PDF in the zip file.
    • Second argument is the page name.
  • tracker-attachments to collect all attachments on a tracker item and store them in a folder.
    • First argument is the name of the folder in which files will be added.
    • Second argument is the ID of the tracker item.
  • tracker-files to collect all files, from the file gallery, on a tracker item and store them in folders.
    • First argument is the name of the base folder in which files will be added, groupped in directories with the name of the field
    • Second argument is the ID of the tracker item.

Example

Sample usage
Copy to clipboard
{ARCHIVEBUILDER(name=DF120-Summary.zip)} page-as-pdf:DF120/Vision.pdf:VisionDF120 page-as-pdf:DF120/Team.pdf:TeamDF120 tracker-attachments:DF120/Requirements/:2232 {ARCHIVEBUILDER}


The output of the available plugin might look like:

  • DF120-Summary.zip
    • DF120/
      • Requirements/
        • performance.doc
        • mockup.png
      • Vision.pdf
      • Team.pdf
    • manifest.txt (automatically generated, containing the list of files)

Sample webservice

generate_pdf.php
Copy to clipboard
<?php $query = $_SERVER['QUERY_STRING']; if( ! empty( $query ) ) { header( 'Content-Type: application/pdf' ); $query = escapeshellarg( urldecode( $query ) ); echo `../wkhtmltopdf-i386 $query -`; } ?>


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

Aliases

ArchiveBuilder | Archive Builder | Plugin Archive Builder | Plugin ArchiveBuilder

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