TIP RtfContrib is not installed on Foswiki.org.

RtfContrib

Extension to translate Foswiki markup to RTF

Usage

The current use is restricted to exporting wiki content from a topic and insert it into a RTF template file. This template file contains tags like %FORMFIELD{"FirstName"}% and %TEXT% which are replaced with the data extracted from the current topic. When you call the rtf CGI script on a topic like this
http://your.domain.com/cgi-bin/foswiki/rtf/Main/TestUser?template=Main.UserForm.user-form.rtf&filename=Hello.rtf
the script will use the RTF template user-form.rtf attached to the topic Main.UserForm and process it as outlined. The result is then cached in a configurable CacheDir under the name Hello.rtf in addition to sending it to the browser. Your browser can be configured to open up the received file with an appropriate word processing tool.

Template tags

The following tags are replaced with data drawn from a topic
Name Description
%TEXT% topic text
%SECTION{"name"}% named topic section
%FORMFIELD{"name"}% formfield of an attched DataForm
%ATTACHMENT{"name" format="..."}% information about attached files
%IMAGE{"url"}% inserts an image downloaded from the given url; supported image formats are jpeg, png, ...

Customizing RTF output

The basic layout of the RTF output is specified by an RTF file that serves as a template. So you have the freedom to create such a document as you like. This extension comes with a few predefined templates that might help you to adjust them to you own needs.

In addition there are some preference variables that determine the formatting of output generate while translating Foswiki markup to RTF.

  • headings: ...
  • lists: ...
  • ...

Configuration

  • $Foswiki::cfg{RtfContrib}{Debug}: debugging flag, defaults to 0
  • $Foswiki::cfg{RtfContrib}{CacheDir}: directory where generated RTF files are cached, defaults to /pub/System/RtfContrib
  • $Foswiki::cfg{RtfContrib}{DefaultRtfTemplate}: RTF file used as a template to create the final RTF file from it when exporting a topic, this can be overriden using the template urlparam on the rtf CGI call

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Plugin Info

Plugin Author(s): Foswiki:Main/MichaelDaum
Copyright: © 2007-2014 Michael Daum http://michaeldaumconsulting.com
License: GPL (Gnu General Public License)
Release: 2.10
Version: 2.10
Change History:  
29 Aug 2014: fully specify rest security
12 Feb 2010: language support in RTF templates
Dependencies:
NameVersionDescription
Foswiki::Plugins::DBCachePlugin>=1.52Required; download from Foswiki:Extensions/DBCachePlugin
Plugin Home: Foswiki:Extensions/RtfContrib
Support: Foswiki:Support/RtfContrib

Topic revision: r5 - 26 Feb 2015, MichaelDaum - This page was cached on 27 Jul 2016 - 13:07.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License