Changes attached DOC files into HTML files and then replaces the content of the topic with an include to the HTML source
Note: a version of this extension is available for use with TWiki. Please contact Foswiki:Main.CrawfordCurrie
for details on how to retrieve it.
Attach a .doc file to a topic, and it will automatically generate a .html version of the attachment. If the topic text contains the magic setting:
* Set REPLACE_WITH_ATTACHMENT = on
then the topic content will automatically be replaced by an include of the (HTML) content of the attachment, using the following template:
- Set REPLACEMENTNOTE = This text was automatically generated from the attachment $attachment
- This site does not allow %INCLUDE% of URLs
This package requires a convertor that can convert from Word documents to HTML. Candidates are wvHtml
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
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions
for more help.
and if necessary adjust the pathname to the convertor program.
There is one other important setting accessible through
. This is an array of (perl) regular expression substitutions that the generated HTML document is processed through. This allows you to rewrite sections of the HTML to remove Microsoft Word features. By default there is a single expression, which rewrites image links in the HTML to refer to the topic attachment directory.
Note that any Foswiki macros in the rewriting rules are expanded before
the rule is applied. Be careful that the expansion of any such macros doesn't add new regular-expression meta-characters.