Go
Welcome, Registration, and other StartingPoints; TWiki history & Wiki style; All the docs...

RtfContrib

Extension to translate TWiki markup to RTF

Usage

The current use is restricted to exporting TWiki data 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/twiki/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 TWiki topic
Name Description
%TEXT% topic text
%SECTION{"name"}% named topic section
%FORMFIELD{"name"}% formfield of an attched TWikiForm
%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 TWiki markup to RTF.

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

Configuration

  • $TWiki::cfg{RtfContrib}{Debug}: debugging flag, defaults to 0
  • $TWiki::cfg{RtfContrib}{CacheDir}: directory where generated RTF files are cached, defaults to /pub/TWiki/RtfContrib
  • $TWiki::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

%$INSTALL_INSTRUCTIONS%

Plugin Info

Plugin Author(s): TWiki:Main/MichaelDaum
Plugin Version: v0.50
Copyright: © 2007-2008 Michael Daum http://michaeldaumconsulting.com
License: GPL (Gnu General Public License)
Change History:  
Dependencies: %$DEPENDENCIES%
Plugin Home: TWiki:Plugins/RtfContrib
Feedback: TWiki:Plugins/RtfContribDev
Appraisal: TWiki:Plugins/RtfContribAppraisal

r1 - 26 Mar 2008 - 21:02:31 - TWikiGuest
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Michael Daum Consulting? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.RtfContrib