The PdfPlugin converts TWiki pages into PDF format on the fly. Basically, it just pipes the rendered page into the tool HTMLDOC.

Typical Use Cases

  • Huge printouts, which need table of contents with page numbers
  • Nice printouts with running headers, logos, properly scaled images
  • Nice presentations with controlled page breaks, automatic sequence etc.
  • Online Manuals in one file with hierarchic navigation

How to write

Technically, the Plugin distinguishes two modes:
Book-mode
large document with <h1> chapter headings; adds title page + table of contents page(s)
Article-mode
if no chapter headings are present, render just a small title header on the first page.

Syntax Rules

Authors

Users have to care only, if they need hand-made presentation markup. Then use the HTML comments understood by the HTMLDOC tool -- see section 4 'tbd' of the manual.

Examples

You have a simple page without <h1> headline: the plugin creates a simple PDF. Then:

  • The page title (its WikiWord?) is inserted as =<h1> headline at the beginning of the text.

You have a large document -- typically with a lot of includes -- and supplied a =<h1> headline. Then:

  • The text section leading up to that first headline is taken as abstract.
  • An extra title page template is loaded, e.g. pdftitle.tmpl.
  • The abstract and the aforementioned fields are filled in. (The native %REVINFO% doesn't cut it for a nice printout.)
  • A table of contents begins on the next sheet.
  • The text body begins on the next sheet.

PdfPlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %INTERWIKIPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules? topic:
    • Set SHORTDESCRIPTION = Use HTMLDOC to postprocess your page into PDF

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 1

  • My own setting: Check the templates directory

Administration

Administrators have a few extra variables to build title page templates:

%ABSTRACT%:
The block of text up to the first headline of level 1
%REVUSER%:
The user who checked in the last revision
%AUTHORLIST%:
Alphabetical lists of all contributors to the plugin.
%REVDATE%:
The date ~
%REV%:
The revision number -- just the plain number w/o leading r1.

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip PdfPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/PdfPlugin.txt Plugin topic
    lib/TWiki/Plugins/PdfPlugin.pm Plugin Perl module
    templates/view.pdf.tmpl skin=pdf to render page body as pdf
    templates/pdfcall.tmpl commandline for external call to HTMLDOC
    templates/pdftitle.tmpl separate titlepage template for any skin, if in book mode
  • Patch bin/view to use this plugin
  • Test if the installation was successful:
    • enter samples here

Plugin Info

Plugin Author: PeterKlausner?
Plugin Version: 24 Sep 2002 (V1.000)
Change History:  
24 Oct 2002: Initial version submitted
CPAN Dependencies: none
Other Dependencies: HTMLDOC from http://www.easysw.com/htmldoc/
Perl Version: 5.005
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/PdfPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/PdfPluginDev

Related Topics:

-- PeterKlausner? - 24 Oct 2002

TWiki > PdfPlugin
Copyright © 1997-2024 California Institute of Technology.