Was this page helpful?

Indexing RTF

    Table of contents
    1. 1. Background
    2. 2. Answer

    Background

    By default, MindTouch does not support the indexing of RTF documents.  To index RTFs, follow the steps below.  This assumes you are running the MindTouch virtual appliance (Debian).

    Answer

    Install unrtf

    apt-get install unrtf
    

    Create the following file:  /var/www/dekiwiki/bin/filters/rtf2txt

    #!/bin/bash
    
    # The converter script requires the 'unrtf' binary
    # To install, run:  apt-get install unrtf
    
    # Setting PATH
    PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
    export PATH
    
    # save stdin to a file since unrtfp doesn't work on streams
    TEMP=`mktemp`
    dd of=$TEMP 2> /dev/null
    
    unrtf --text "$TEMP"  | sed -e '/^###/d' -e 's/### invalid font number [0-9]\+//'
    rm $TEMP
    

    Make the script executable

    chmod +x /var/www/dekiwiki/bin/filters/rtf2txt
    

    Enable the indexer in /etc/dekiwik/mindtouch.deki.startup.xml

    Add the following line to the <indexer> section of your startup.xml

    <filter-path extension="rtf">/var/www/dekiwiki/bin/filters/rtf2txt</filter-path>
    

    Restart the service

    /etc/init.d/dekiwiki restart
    
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by