[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice
Subject:    Re: http://www.koffice.org/filters/index.html
From:       "Shaheed Haque" <shaheedhaque () hotmail ! com>
Date:       2001-01-05 21:03:52
[Download RAW message or body]

Per,

It looks good to me. If you want to checkout the killustrator EPS, and write 
up a status page using

http://webcvs.kde.org/cgi-bin/cvsweb.cgi/www/koffice/filters/TEMPLATE_STATUS.html

as a template along with an updated page, I'd be happy to verify and check 
both in for you. Thanks for your efforts,

Shaheed

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

["index.html" (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
  "http://www.w3.org/TR/REC-html40/loose.dtd">

<html>

<head>

<title>KOffice: filters</title>

</head>

<body bgcolor="#ffffff" text="#000000" link="#000099" alink="#666666"
  vlink="#666666">

<A NAME="start"></A>

<center>
<p>
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tr><td valign=top alignÎnter width5>
      <a href=""><img src="../pics/kgear.gif" border=0 width3 height5
      alt="K"></a></td>
    <td rowspan=4 width%>
      <img src="../pics/invis.gif" height=1 width% alt="" border=0></td>
    <td valign=middle alignÎnter rowspan=2 width="100%"
      background="../pics/all_shot_banner.gif">&nbsp;
    <center><h1>Filters for KOffice</h1></center>
    </td>
    <td rowspan=4 width>
      <img src="../pics/invis.gif" height=1 width alt="" border=0></td>
</tr>
<tr><td valign=middle alignÎnter bgcolor="#FFFFFF" width5>
      <a href=""><img src="../pics/office_banner.gif" border=0 width5
      height0 alt="Office"></a></td>
</tr>
<tr><td colspan=3>&nbsp;<br></td></tr>
<tr><td valign=top align=left width5>
      <table border=0 cellpadding=1 cellspacing=0>
      <tr><td valign=top align=left colspan=2>
            <b>Information</b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b>
            <a href="http://www.kde.org/">KDE Home</a></b></font></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="../news.phtml">News</a></b></font></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b>
            <a href="../faq/index.html">FAQs</a></b></font></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b>
            <a href="../getinvolved/index.html">Getting Involved</a></b></font></td>
      </tr>
<!--
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="n">Documentation</a></b></font></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="n">Wish List</a></b></font></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="n">Developers
            Gallery</a></b></font></td>
      </tr>
-->
      <tr><td colspan=2>&nbsp;<br></td></tr>
      <tr><td valign=top align=left colspan=2>
            <b>Installing KOffice</b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="../install-source.phtml">Sources</a>
            </b></font></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="../install-binaries.phtml">Binaries</a>
            </b></font></td>
      </tr>
<!--
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="n">Download</a></b></font></td>
      </tr>
-->
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="../mirrors.phtml">Mirrors</a></b></font>
          </td>
      </tr>
      <tr><td colspan=2>&nbsp;<br></td></tr>
      <tr><td valign=top align=left colspan=2>
            <b>KOffice Components</b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/kword.gif" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b><a href="../kword/">KWord</a></b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/kspread.gif" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b><a href="../kspread/">KSpread</a></b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/kpresenter.gif" border=0 width  height 
              alt=""></td>
          <td valign=top align=left>
            <b><a href="../kpresenter/">KPresenter</a></b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/killustrator.gif" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b><a href="../killustrator/">KIllustrator</a></b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/kimageshop.gif" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b><a href="../kimageshop/">Krayon</a></b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/katabase.gif" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b><a href="../katabase/">Katabase</a></b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/kformula.gif" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b><a href="../kformula/">KFormula</a></b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/kchart.gif" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b><a href="../kchart/">KChart</a></b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/kivio.png" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b><a href="http://www.thekompany.com/projects/kivio/">
               Kivio</a></b></td>
      </tr>
<!--
      <tr><td valign=top align=left width >
            <img src="../pics/kimage.gif" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b><a href="../kimage/">KImage</a></b></td>
      </tr>
-->
      <tr><td valign=top align=left width >
            <img src="../pics/filters.gif" border=0 width  height 
            alt=""></td>
          <td valign=top align=left>
            <b>Filters</b></td>
      </tr>
      <tr><td colspan=2>&nbsp;<br></td></tr>
      <tr><td valign=top align=left colspan=2>
            <b>Contact Information</b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="../developers.phtml">Developers</a></b>
            </font></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="../contact.phtml#bugs">Bug Reporting</a>
            </b></font></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="../contact.phtml#lists">Mailing Lists</a>
            </b></font></td>
      </tr>
      <tr><td colspan=2>&nbsp;<br></td></tr>
      <tr><td valign=top align=left colspan=2>
            <b>Supporting KOffice</b></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="../support.phtml">Supporting
            KOffice</a></b></font></td>
      </tr>
      <tr><td valign=top align=left width >
            <img src="../pics/line.gif" border=0 width  height alt=""></td>
          <td valign=top align=left>
            <font size="-1"><b><a href="../supporters.phtml">Supporters of
            KOffice</a></b></font></td>
      </tr>
      </table></td>
    <td valign=top align=left>

      <B>
      <A HREF="#toc1">1. Do we really need filters?</A><BR>
      <A HREF="#toc2">2. Which filters are there?</A><BR>
      <A HREF="#toc3">3. Which filters are most wanted?</A><BR>
      <A HREF="#toc4">4. How to use a filter?</A><BR>
      <A HREF="#toc5">5. Developing Filters for KOffice</A><BR>
      <A HREF="#toc51">5.1. Prepare the Environment</A><BR>
      <A HREF="#toc52">5.2. Behind the Scenes</A><BR>
      <A HREF="#toc53">5.3. How to Develop a Filter?</A><BR>
      <A HREF="#toc54">5.4. Remaining Questions?</A><BR>
      <A HREF="#toc55">5.5. File Formats - Doctype Definitions</A><BR>
      <A HREF="#toc56">5.6. Special Filters</A><BR>
      <A HREF="#toc57">5.7. Add Documentation</A><BR>
      <A HREF="#toc58">5.8. Links for Developers</A><BR><BR>
      </B>

      <hr noshade size=1><BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc1"><U>1. Do we really need filters?</U></A>
      </h2>
      <p>In my opinion we definitely need filters because a important factor \
                influencing
      the success of an office suite is the ability to import and export documents.
      Of course this is not critical stuff like printing or a nice and
      straightforward user interface, but it's not just a "nice-to-have" feature,
      either.</p>
      <p>Just imagine a user working in a heterogenous environment using KOffice
      among other office suites. Sometimes it is necessary to exchange documents
      as we all know. Now the adventure begins:</p>
      <ul><li> Which format do I use (i.e. Which format is supported by both office \
                suites)?</li>
      <li>How much information is lost due to internal differences between the office
      suites (e.g. formatting, tables, pictures, columns,...)?</li>
      <li>What about the character sets (i.e. the encoding of umlauts and so \
                on)?</li>
      <li>Can I use Unicode characters in the other office suite?</li></ul>
      Another problem is that some vendors of proprietary office suites provide
      inaccurate and/or incomplete documentation of the file formats (or no \
                information at all).
      This is one of the obstacles we face because it's really time consuming to \
                search
      for information in a binary file as you can imagine... (At this place I'd like \
to  thank Espen Sand for his brillant
      <a href="http://home.sol.no/~espensa/khexedit">KHexEditor</a> <I>(should be \
working if you have install KDE2 with <B>kdeutils</B>).</I>  <BR><BR><BR><BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc2"><U>2. Which filters are there?</U></A>
      </h2>
      <p>Well, at the moment all parts of KOffice support the filter architecture
      (read: the parts are able to use filters), but there are working
      filters only for some parts. These include:</p>

   <center>
    <table border=0 cellspacing=0 cellpadding=1 bgcolor="#000000">
     <tr>
      <td>
       <table border=0 cellspacing=1 cellpadding=3 bgcolor="#DDDDDD">
        <tr>
         <td colspan=4 BGCOLOR="#AAAAFF">
          <font size=+1><center><B>kword</B></center></font>
         </td>
        </tr>

        <tr>
         <td><center><B>type</B></center></td>
         <td><center><B>info</B></center></td>
         <td><center><B>import</B></center></td>
         <td><center><B>export</B></center></td>
        </tr>

        <tr>
         <td>- ASCII</td>
         <td>i.e. plain text</td>
         <td alignÎnter>
          <A HREF="kword_ascii_status.html#import?content-type=text/html">
           <FONT COLOR="#00AA00">yes</FONT></A>
         </td>
         <td alignÎnter>
          <A HREF="kword_ascii_status.html#export?content-type=text/html">
           <FONT COLOR="#00AA00">yes</FONT></A>
         </td>
        </tr>

        <tr>
         <td>- HTML</td>
         <td>&nbsp;</td>
         <td alignÎnter>
          <A HREF="kword_html_status.html#import?content-type=text/html">
           <FONT COLOR="#00AA00">yes</FONT></A>
         </td>
         <td alignÎnter>
          <A HREF="kword_html_status.html#export?content-type=text/html">
           <FONT COLOR="#00AA00">yes</FONT></A>
         </td>
        </tr>

        <tr>
         <td>- MS WinWord 97</td>
         <td>97 + 2000</td>
         <td alignÎnter>
          <A HREF="kword_winword_status.html#import?content-type=text/html">
           <FONT COLOR="#00AA00">yes</FONT></A>
         </td>
         <td alignÎnter>-</td>
        </tr>

        <tr>
         <td>- DocBook</td>
         <td>&nbsp;</td>
         <td alignÎnter>-</td>
         <td alignÎnter>
          <A HREF="kword_docbook_status.html#export?content-type=text/html">
           <FONT COLOR="#00AA00">yes</FONT></A>
         </td>
        </tr>

        <tr>
         <td>- Applix Word</td>
         <td>&nbsp;</td>
         <td alignÎnter>
          <A HREF="kword_applixword_status.html#import?content-type=text/html">
           <FONT COLOR="#AAAA00">beta</FONT></A>
         </td>
         <td alignÎnter>
         -
         </td>
        </tr>

        <tr>
         <td>- LaTEX</td>
         <td>&nbsp;</td>
         <td alignÎnter>-</td>
         <td alignÎnter>
          <A HREF="kword_latex_status.html#export?content-type=text/html">
           <FONT COLOR="#AAAA00">beta</FONT></A>
         </td>
        </tr>

        <tr>
         <td>- RTF</td>
         <td>&nbsp;</td>
         <td alignÎnter>
          <A HREF="kword_rtf_status.html#import?content-type=text/html">
           <FONT COLOR="#AA0000">bad</FONT></A>
         </td>
         <td alignÎnter>-</td>
        </tr>

        <tr>
         <td>- MIF</td>
         <td>&nbsp;</td>
         <td alignÎnter>
          <A HREF="kword_mif_status.html#import?content-type=text/html">
           <FONT COLOR="#AA0000">bad</FONT></A>
         </td>
         <td alignÎnter>-</td>
        </tr>

        <tr>
         <td colspan=4 bgcolor="#FFFFFF">&nbsp;<BR>&nbsp;</td>
        </tr>


        <tr>
         <td colspan=4 BGCOLOR="#AAFFAA">
           <font size=+1><center><B>kspread</B></center></font>
         </td>
        </tr>
        <tr>
         <td><center><B>type</B></center></td>
         <td><center><B>info</B></center></td>
         <td><center><B>import</B></center></td>
         <td><center><B>export</B></center></td>
        </tr>

        <tr>
         <td>- CSV</td>
         <td>Comma Separated Values</td>
         <td alignÎnter>
          <A HREF="kspread_csv_status.html#import?content-type=text/html">
           <FONT COLOR="#00AA00">yes</FONT></A>
         </td>
         <td alignÎnter>
          <A HREF="kspread_csv_status.html#export?content-type=text/html">
           <FONT COLOR="#00AA00">yes</FONT></A>
         </td>
        </tr>

        <tr>
         <td>- MS Excel 97</td>
         <td>97 + 2000</td>
         <td alignÎnter>
          <A HREF="kspread_excel_status.html#import?content-type=text/html">
           <FONT COLOR="#00AA00">yes</FONT></A>
         </td>
         <td alignÎnter>-</td>
        </tr>
        <tr>
         <td colspan=4 bgcolor="#FFFFFF">&nbsp;<BR>&nbsp;</td>
        </tr>


        <tr>
         <td colspan=4 BGCOLOR="#FFAAAA">
           <font size=+1><center><B>kpresenter</B></center></font>
         </td>
        </tr>
        <tr>
         <td><center><B>type</B></center></td>
         <td><center><B>info</B></center></td>
         <td><center><B>import</B></center></td>
         <td><center><B>export</B></center></td>
        </tr>
        <tr>
         <td>- MS PowerPoint 97</td>
         <td>&nbsp;</td>
         <td alignÎnter>
          <A HREF="kpresenter_powerpoint_status.html#import?content-type=text/html">
           <FONT COLOR="#AA0000">bad</FONT></A>
         </td>
         <td alignÎnter>-</td>
        </tr>
        <tr>
         <td colspan=4 bgcolor="#FFFFFF">&nbsp;<BR>&nbsp;</td>
        </tr>


        <tr>
         <td colspan=4 BGCOLOR="#AAFFFF">
           <font size=+1><center><B>killustrator</B></center></font>
         </td>
        </tr>
        <tr>
         <td><center><B>type</B></center></td>
         <td><center><B>info</B></center></td>
         <td><center><B>import</B></center></td>
         <td><center><B>export</B></center></td>
        </tr>

        <tr>
         <td>- MSOD</td>
         <td>MS Office Drawing</td>
         <td alignÎnter>
          <A HREF="killustrator_msod_status.html#import?content-type=text/html">
           <FONT COLOR="#AAAA00">beta</FONT></A>
         </td>
         <td alignÎnter>-</td>
        </tr>

        <tr>
         <td>- WMF</td>
         <td>Windows MetaFile</td>
         <td alignÎnter>
          <A HREF="killustrator_wmf_status.html#import?content-type=text/html">
           <FONT COLOR="#AAAA00">beta</FONT></A>
         </td>
         <td alignÎnter>-</td>
        </tr>

        <tr>
         <td colspan=4 bgcolor="#FFFFFF">&nbsp;<BR>&nbsp;</td>
        </tr>



        <tr>
         <td colspan=4 BGCOLOR="#FFFFAA">
          <font size=+1><center><B>Krayon</B></center></font>
         </td>
        </tr>

        <tr>
         <td><center><B>type</B></center></td>
         <td><center><B>info</B></center></td>
         <td><center><B>import</B></center></td>
         <td><center><B>export</B></center></td>
        </tr>
        <tr>
         <td>-</td>
         <td>&nbsp;</td>
         <td alignÎnter>-</td>
         <td alignÎnter>-</td>
        </tr>
        <tr>
         <td colspan=4 bgcolor="#FFFFFF">&nbsp;<BR>&nbsp;</td>
        </tr>



        <tr>
         <td colspan=4 BGCOLOR="#FFEEFF">
           <font size=+1><center><B>kivio</B></center></font>
         </td>
        </tr>
        <tr>
         <td><center><B>type</B></center></td>
         <td><center><B>info</B></center></td>
         <td><center><B>import</B></center></td>
         <td><center><B>export</B></center></td>
        </tr>

        <tr>
         <td>-</td>
         <td>&nbsp;</td>
         <td alignÎnter>-</td>
         <td alignÎnter>-</td>
        </tr>
       </table>
      </td>
     </tr>
    </table>
</center>











      <BR>
      <FONT COLOR="#00AA00">yes</FONT> = It's a good working filter<BR>
      <FONT COLOR="#AAAA00">beta</FONT> = It's a first beta version of a filter - \
                does something <BR>
      <FONT COLOR="#AA0000">bad</FONT> = If's a first alpha version of a filter - \
does nothing good<BR><BR>  If you are looking for some information about the actuall \
<B>status</B> of the different filters you only have to click yes/beta/bad text in \
the import/export column.<BR><BR>  I can think of many filters we'd like to have, but \
sadly we are only  a few developers. <BR>
      Do <i>you</i> want to join us? <BR>
      And do you want to help with develop one of the next or another filter.
      <BR><BR><BR><BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc3"><U>3. Which filters are most wanted?</U></A>
      </h2>
      <B>Which filters would be nice for koffice to get a better place?!</B>
      <BR>
      <p>At the moment I think the "most wanted" filter would be a RTF import
      and export filter for KWord as you can exchange RTF documents with nearly
      all office suites. Obviously there is more need for KWord and KSpread
      filters  than for KPresenter filters.</p>

      <B><I><U>Here is a first list:</U></I></B><BR>
      <ul><li><B><I>KWord:</B></I></li>
        <ul><li>Rich Text Format</li>
        <li>MIF <B><I>(Adobe)</I></B></li>
        <li>StarWriter <B><I>(SUN)</I></B></li>
        <li>WordPerfect <B><I>(Corel)</I></B></li>
        <li>Abiword <B><I>(Gnome)</I></B></li>
        <li>Word'95 <B><I>(MS)</I></B></li>
        <li>.....</li></ul>
      <li><B><I>KSpread:</B></I></li>
        <ul><li>StarCalc <B><I>(SUN)</I></B></li>
        <li>Gnumeric <B><I>(Gnome)</I></B></li>
        <li>ApplixSpread <B><I>(ApplixWare)</I></B></li>
        <li>xspread</li>
        <li>Excel'95 <B><I>(MS)</I></B></li>
        <li>Lotus 123</li>
        <li>..... </li></ul>
      <li><B><I>KPresenter:</I></B></li>
        <ul><li>PowerPoint 97 <B><I>(MS)</I></B></li>
        <li>StarImpress <B><I>(SUN)</I></B></li>
        <li>Presentations <B><I>(Corel)</I></B></li>
        <li>PowerPoint'95 <B><I>(MS)</I></B></li>
        <li>..... </li></ul>
      <li><B><I>KIllustrator:</I></B></li>
        <ul><li>StarDraw <B><I>(SUN)</I></B></li>
        <li>xfig<BR></li>
        <li>..... </li></ul>
      <li><B><I>Krayon:</I></B></li>
        <ul><li>..... </li></ul>
      <li><B><I>	Kivio:</I></B></li>
        <ul><li>Dia <B><I>(Gnome)</I></B></li>
        <li>Visio <B><I>(MS)</I></B></li>
        <li>..... </li></ul></ul>
      <BR>
      - Quattro Pro <B><I>(Corel)</I></B><BR>
      - ApplixGraphics <B><I>(ApplixWare)</I></B><BR>

      <p><B>MIF Info:</B><BR>
      MIF files are an predecesser to XML, used only by Adobe Framemaker.
      It is a tag based, ascii only file. Since framemaker can use pictures it can
      also embed pictures
      into the file. Still in use and it has a new file-format in the new
      Framemaker 6 that is (according to Adobe) not downwards compatible
      (Frame 5.5 can not load Frame 6.0 mifs)</p>
      VERY good to have as an import/export filter for kword.<BR>
      <BR><BR><BR><BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc4"><U>4. How to use a filter?</U></A>
      </h2>
      <p>The Koffice Library Developers have done a magnificent job and you
      will not even notice when you use a filter to convert a file to the
      part's native format. Ok, you can see it (debug output), but there is no
      difference for you at all. Just select <BR>
      <code><B><I>File -> Open...</I></B></code> for import or <BR>
      <code><B><I>File -> Save</I></B></code> or
      <code><B><I>File -> Save As...</I></B></code>
      for export <BR>
      and choose
      the extension which should be used.
      Select (or name) the file and off you go :)</p>
      <BR><BR><BR><BR>


      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc5"><U>5. Developing Filters for KOffice</U></A>
      </h2>

      <BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc51">5.1. Prepare the Environment</A>
      </h2>

      <p>As KOffice needs KDE 2 it's necessary to install at least parts of
      <B>KDE 2</B> (<B><I>Qt, kdesupport, kdelibs, kdebase - exactly in this
      order</I></B>) and - of course - <B><I>KOffice</I></B>. I recommend
      looking for
      further information on <a href="http://www.koffice.org/install-source.phtml">
      how to install</a> it. To get some help from real KOffice experts please
      <a href="http://www.kde.org/contact.html">join the KOffice mailing list</a>
      (koffice@kde.org  or  koffice-devel@kde.org). There is an archive of
      those lists and you can find them all at
      <A HREF="http://lists.kde.org">http://lists.kde.org</A>.<BR>
      One final hint: Add <code><B><I>-debug</I></B></code> to your
      <code><B><I>./configure </I></B></code> options for Qt and
      <code><B><I>--enable-debug</I></B></code> to your
      <code><B><I>./configure</I></B></code> options for all KDE packages.
      The resulting
      binaries are quite large and a little bit slower, but nonetheless this
      is an enormous help if you are developing (Þbugging :) something. <BR>
      Oh, and use <a href="ftp://ftp.gnu.org/pub/gnu/gdb/"><B>gdb-5.0</B></a>
      or later, because gdb-4.x always crashed on KOffice stuff (at least for
      me).</p>
      <BR><BR><BR><BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc52">5.2. Behind the Scenes</A>
      </h2>
      <p>There are several ways for programming a filter depending on your
      needs. However, unless you <i>really</i> need a non-standard filtering
      method (e.g. because you'd like to import huge amounts of data and the
      performance is bad) we recommend using the plain and easy standard
      method. All the following descriptions are based on the assumption that
      you use the standard filtering method. The gory details about the
      optimized (read: hacky) methods of filtering are provided at the bottom
      of this page (Note: I didn't add a link, because you have to
      <i>scroll</i> the standard description, at least :).</p>
      <p>KOffice uses a quite straightforward approach to convert files to the
      native format of the matching KOffice part. I'll try to explain this
      via a simple example (from the user's point of view) before providing
      further (more detailed) information:</p>
      <ol>
       <li>The user activates <code><B><I>File -> Open...</I></B></code>
       <li>The file dialog pops up
       <li>She/He selects a file extension (e.g. *.csv [cvs = Comma Separated
           Value])
       <li>Now the file dialog shows only the matching files
       <li>Depending on the filter, the user might see a configuration dialog.
           This (optional) dialog is "embedded" in the file dialog.
           It can be used to pass configuration options to the filter (i.e. a
           kind of replacement for commandline arguments)
       <li>After selecting a file she/he presses <code><B><I>Ok</I></B></code>
       <li>The filter converts the file to KSpread's native format
           (taking the configuartion options into account)
       <li>KSpread opens a (native!) file
       <li>The user is happy :)
      </ol>
      <p>When saving documents the filtering works nearly identical. The whole
      process of looking for available filters,... is done by the KOffice
      Libraries so you don't have to care about that. As you can see there is
      no magic involved and as we now know the basics let's have a look how
      this really works!</p>
      <p>After the user clicked <code><B><I>File -> Open...</I></B></code> the
      part queries the <code><B><I>KoFilterManager</I></B></code>
      (koffice/lib/kofficecore/koFilterManager.cc) to prepare the file dialog.
      <BR>
      The filter manager (=<code><B><I>KoFilterManager</I></B></code>) queries
      the trader for information on the supported filter types (e.g. HTML,
      TXT,...) and configuration dialogs. Then it prepares the KFD (K File
      Dialog) to show all this stuff. The file dialog pops up and now the user
      can select a specific filter (e.g. '*.csv'). After selecting a file (with
      the correct extension - the file dialog ensures that) the user might have
      to set some configuration options (Note: You don't <i>have</i> to
      provide such a dialog, it's just a nifty feature for some obscure
      filters which need passwords and so on (i.e. some kind of user input)!),
      clicks <code><B><I>Ok</I></B></code> and the filename is returned to the
      part. The part
      passes the filename to the filter manager. The filter manager checks
      whether the file is native or not. If if is native, the filter manager
      returns the name and the part opens it. If it is not, the filter manager
      returns another filename - this is the name of the converted file (a
      temporary file somewhere in /tmp). Finally the part opens the converted
      (=native) file.</p>
      <p>But when does the real converting occur? Let's see... the filter
      manager gets the filename (and the mimetype of the calling part). It
      tries to find out the mimetype of the file which should be opened. Then
      the trader is queried if there is a filter which is able to handle those
      two mimetypes (the one of the file to convert and the native format of
      the application, e.g. HTML -> KWord). If such a filter is found the
      filter manager loads it and passes the information of the optional
      configuration dialog.</p>
      <p>Filters are <i>shared libs</i> which are opened on demand (via
      KLibLoader, which is a wrapper for dlopen) and closed after a few
      minutes of inactivity
      (so that we don't waste too much memory). All the filters have to inherit
      <code><B><I>KoFilter</I></B></code> (koffice/lib/kofficecore/koFilter.h)
      and they have to override the pure virtual method <code><B><I>filter(...)
      </I></B></code>. This
      method is called by the filter manager (for details see below) and the
      filter starts to convert the file (i.e. opens the file, reads it,
      converts the contents, writes it).</p>
      <BR><BR><BR><BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc53">5.3. How to Develop a Filter?</A>
      </h2>
      <p>Please have a look at <b><i>koffice/filters/kword/ascii/asciiimport*
         </i></b> if you
      want to write an import filter, at
      <b><i>koffice/filters/kword/ascii/asciiexport*</i></b> if you
      want to write an export filter. (and exchange "import" by "export"
      below). </p>
      <B>To create a filter you have to:</B>
      <ol>
        <li>Copy the appropriate files from the koffice/filters/kword/ascii
            directory to a separate directory (at least Makefile.am,
            asciiimport*, and kword_ascii_import.desktop).
        <li>Create a "factory" class for your filter. This factory is needed
            to load the filter (as we've heard, technically the filter is a
            shared library which is "dlopened" on demand). You only have to
            change all the names in 'asciiimport_factory.cc' and
            'asciiimport_factory.h' (i.e. all the <code>ASCII</code>,
            <code>Ascii</code>, and <code>ascii</code> stuff has to be
            replaced by <code>YOURFILTER</code>
            , <code>YourFilter</code>, and <code>yourfilter</code>).
        <li>Derive your "main-filter-class" from <code>KoFilter</code>. Look
            at 'asciiimport.cc' and 'asciiimport.h' how this is done. Don't
            forget that you have to include or link the moc file - otherwise
            the filter won't work! (the classname is needed during
            "incarnation," and all this information is stored in those nifty
            little moc files).
        <li>Rename the files (ascii* -> yourfilter*) if you haven't done this,
            yet.
        <li>Add your classes (i.e. the files containing the C++
            headers/sources) which are needed to convert the file (for an
            example have a look at the export filter in
            koffice/filters/kword/html/). Remember: The filter is a
            "normal" library, so you may do whatever you can do with
            libraries :)
        <li>Adjust the *.desktop file (Note: You'll have to rename the file or
            it won't work correctly because you'll overwrite something!).
            In the file you'll have to change the "Name", "Comment", "Export",
            "ExportDescription", "Import", "ImportDescription",
            "X-KDE-Library", and probably the "Icon" and "MiniIcon" fields.
        <li>If KDE doesn't "know" your filetype up to now, please add a
            x-*.desktop file (see koffice/filters/kspread/csv). Make sure that
            it gets installed to the correct directory. If KDE knows your
            filetype, you don't have to care about that.
        <li>Adapt the local Makefile.am by renaming/adding files to meet your
            needs.
        <li>If your directory is located somewhere in the koffice/filters
            directory,
            <ol type="a">
              <LI>just add your directory to the <B><I>Makefile.am</I></B> file of
                  the parent directory. <BR>
              <LI>Execute <code><B><I>make -f Makefile.cvs</I></B></code> in the
                  top directory (koffice/) (or use create_makefile(s) from
                  kdesdk/scripts) <BR>
              <LI>and <code><B><I>./configure</I></B></code> the whole stuff again.
                  If it compiles you've won :) . <BR>
              <LI>Install (<code><B><I>make install</I></B></code>)  <BR>
              <LI>and test it...
            </ol>
      </ol>

      <p><B>To create an optional configuration dialog you have to:</B></p>
      <ol>
        <li>Create a "factory" class for the dialog (like for the filter
            above). If you look for an example/template:
            koffice/filters/kspread/csv/csvfilterdia* is quite straightforward.
        <li>Design and implement the real dialog. It has to inherit
            <code><B><I>KoFilterDialog</I></B></code>.
            Of course you have to override the pure virtual method
            <code><B><I>state()</I></B></code>. This method returns a
            <code><B><I>QString</I></B></code>
            which contains the configuration information.
            You might want to use some Qt geometry management magic to make
            the dialog look nice.
        <li>The format of this string is up to you, but I suggest using a
            simple XML-like format (using QDom/QXML) because it's easy to
            debug.
        <li>Create (or modify) the .desktop file (template from the CSV filter)
        <li>Extend the Makefile.am file (see koffice/kspread/csv/Makefile.am
            for details) <BR>
            and re-run <code><B><I>make -f Makefile.cvs</I></B></code> <BR>
            and <code><B><I>./configure</I></B></code>.
        <li>Make sure that your dialog neither has any
            <code><B><I>Ok</I></B></code> and/or
            <code><B><I>Cancel</I></B></code> buttons, nor menubars/toolbars.
            Shortly put:
            Make it really simple.
        <li>Note: A KOffice part may be launched from the commandline passing
            a filename. This file gets opened regardless if it is a native one
            or not. Of course then no file dialog gets opened and your dialog
            is not shown. You can detect this situation by testing the QString
            in the filter() method against QString::null. If you still
            want to have the dialog, you have to show it "manually." To give
            you some ideas:
            Fist you have to load the dialog's lib (via KLibLoader) and use
            the factory class to create a dialog (maybe you'll have to adapt
            the factory class to be able to do that). Then you'll have to
            create a <i>real</i> dialog (with an <code><B><I>Ok</I></B></code>
            button, at least) and embed your configuration dialog (i.e. the
            real dialog is the parent of your dialog widget). Then wait for
            the user to click <code><B><I>Ok</I></B></code> and use the
            dialog's status() method to read the information.
      </ol>

      <p>Wow - you wrote a filter! But what now? You don't have a CVS account
      and you want to check it in? No problem. Please send all the files to
      me, Werner Trobin,
      <a href="mailto:trobin@kde.org">&lt;trobin@kde.org&gt;</a>. Note: It's
      no problem whatsoever if you send your "drafts" - that's what CVS is
      good for!</p>
      <BR><BR><BR><BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc54">5.4. Remaining Questions?</A>
      </h2>
      <p>Feel free to ask <a href="mailto:trobin@kde.org">me</a> if there are
      any remaining questions. BTW: It's generally a good idea to ask on
      <a href="mailto:koffice@kde.org">koffice@kde.org</a> whether anyone
      works on a filter before starting to implement it :)</p>
      <BR><BR><BR><BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc55">5.5. File Formats - Doctype Definitions</A>
      </h2>
      <p>This section contains some useful documentation (I'll add more stuff
      here, soon):</p>

      <ul>
       <li><B>KWord Doctype Definition</B><BR>
           Download: &nbsp;&nbsp;
           <a href="http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/koffice/kword/dtd/kword.dtd?content-type=text/plain"><B>WebCVS \
(current)</B></A>&nbsp;&nbsp; or &nbsp;&nbsp;  look in your local koffice copy in
           <B>koffice/kword/dtd/kword.dtd</B>
           <BR><BR>

       <li><B>KSpread Doctype Definition</B><BR>
           Download: &nbsp;&nbsp;
           <a href="http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/koffice/kspread/dtd/kspread.dtd?content-type=text/plain"><B>WebCVS \
(current)</B></A>&nbsp;&nbsp; or &nbsp;&nbsp;  look in your local koffice copy in
           <B>koffice/kspread/dtd/kspread.dtd</B>
           <BR><BR>

       <li><B>Killustrator Doctype Definition</B><BR>
           Download: &nbsp;&nbsp;
           <a href="http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/koffice/killustrator/kil.dtd?content-type=text/plain"><B>WebCVS \
(current)</B></A>&nbsp;&nbsp; or &nbsp;&nbsp;  look in your local koffice copy in
           <B>koffice/killustrator/kil.dtd</B>
           <BR><BR>

       <li><B>Kpresenter Doctype Definition</B><BR>
           Download: &nbsp;&nbsp;
           <a href="http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/koffice/kpresenter/dtd/kpresenter.dtd?content-type=text/plain"><B>WebCVS \
(current)</B></A>&nbsp;&nbsp; or &nbsp;&nbsp;  look in your local koffice copy in
           <B>koffice/kpresenter/dtd/kpresenter.dtd</B>
           <BR><BR>

       <li><B>Krayon Doctype Definition</B><BR>
           Download: &nbsp;&nbsp;
           <a href="http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/koffice/kimageshop/dtd/krayon.dtd?content-type=text/plain"><B>WebCVS \
(current)</B></A>&nbsp;&nbsp; or &nbsp;&nbsp;  look in your local koffice copy in
           <B>koffice/kimageshop/dtd/krayon.dtd</B>
           <BR><BR>
     </ul>


     Here is a little advise (from IBM) how to read doctype descritions. If you look \
                at that page it shouldn't be a problem to understand how to read \
                them.<BR>
     &nbsp;&nbsp; <A \
HREF="http://www-106.ibm.com/developerworks/library/buildappl/writedtd.html"><B>Doctype \
Description</B></A>

      <BR><BR><BR><BR>

      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc56">5.6. Special Filters</A>
      </h2>
      <p>As I already said above sometimes the standard filter interface is
      just a little bit to slow, complicated(?!?), annoying,... To prevent
      you from trying to circumvent our interface we've done it for you,
      already. It's not clean, it's not save, but it should at least be fast.
      Once again I'd like to warn you, but I'm sure you won't listen to me,
      anyways.</p>
      <p>If you read the definiton of the <code><B><I>KoFilter</I></B></code>
      class, you can see that there are more pure virtual methods, than just
      <code><B><I>filter(...)</I></B></code>:</p>
      <ul>
        <li><code><B><I>virtual const bool I_filter(const QCString &file,
            const QCString &from,
            QDomDocument &doc, const QCString &to, const QString
            &config=QString::null);</I></B></code><br>
            This method can only be used to import documents (hence the 'I_').
            The difference to the standard method is that you don't write to
            a file, but to a QDomDocument. This document is opened directly
            from the KOffice application. The advantage is, that there are no
            temporary files involved; the disadvantage is, that the application
            has to support it. At the moment only KSpread supports this kind
            of import.
        <li><code><B><I>virtual const bool I_filter(const QCString &file,
            KoDocument *document, const QCString &from, const QCString &to,
            const QString &config=QString::null);</I></B></code><br>
            This one is even more hacky than the above one (and it's also for
            importing documents).
            Here you get direct access to an empty KoDocument(!). Please use
            this one only in very rare cases (e.g. where you have to transfer
            enormous amounts of data). Another huge disadvantage of that
            method (besides being insecure) is, that you'll have to
            change the filter, if the interface of the part changes.
        <li><code><B><I>virtual const bool E_filter(const QCString &file,
            const KoDocument * const document, const QCString &from, const
            QCString &to, const QString &config=QString::null);</I></B></code>
            <br>
            Well - that's still not enough for you? This method delivers a
            KoDocument which is used by the application (i.e. it's "full," not
            empty like the above one). Of course this method is used to export
            documents. Did I already say that you should use this method only
            if this is the only way out?
      </ul>
      <p>If you need some inspiration how to implement these kinds of methods,
      just have a look at koffice/filters/kspread/csv. You surely already
      know, that you can even use a configuration dialog with these filtering
       methods, too.</p>
      <BR><BR><BR><BR>

     <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc57">5.7. Add Documentation</A>
      </h2>
      <p>So if you have done your filter please add some information. <BR>
      At least add a statusfile <code><B><I>status.html</B></I></code>. Inside
      of that file you should insert </p>
      <UL>
       <LI>a <B>feature list</B>,
       <LI>a <B>history list</B>,
       <LI>a <B>todo list</B>,
       <LI>maybe some nice <B>links</B> to more information
          (fileformat description, ...),
       <LI>the <B>author('s)</B> of the filter with <B>email-addresses</B>,
       <LI><B>last page update</B>.
      </UL>
      <p>Whenever you obtain <B>any information</B> about the filter
      <B>update</B> the <code><B><I>status.html</B></I></code> file.
      The status file may contain the result of a
      finished investigation (e.g. can code be reused from another open source
      project if yes how, if no why not) or even the experience of a not
      finished investigation, and of course the possibilities the filter
      currently provides.</P>

      There is a statusfile template where you can look at.
      Statusfile template is here:
      <A HREF="status_template.html">temp</A>&nbsp;&nbsp;
      <p>If you have done your documentation and the tables are looking right mail \
it.

      <p>If you are doing some update don't forget to update your documentation \
too!</p>  <BR><BR><BR><BR>


      <h2>
       <A HREF="#start"><IMG SRC="uparrow.gif" BORDER="0" ALT="Go to the top of this \
page"></A>&nbsp;&nbsp;  <A NAME="toc58">5.8. Links for Developers</A>
      </h2>
      <p>During all the hours on the net searching for information on file
      formats and stuff like that, I came across some very interesting
      homepages:</p>
      <CENTER>
      <table border=0 cellspacing=0 cellpadding=1 BGCOLOR="#EEEEFF">
       <tr>
        <td><a href="http://www.wotsit.org">
             <FONT SIZE=-0>http://www.wotsit.org</FONT></a></td>
        <td>Information on various file formats</td>
       </tr>
       <tr BGCOLOR="#CCCCFF">
        <td><a href="http://msdn.microsoft.com">
             <FONT SIZE=-0>http://msdn.microsoft.com</FONT></a> </td>
        <td>The MS Developer's Network Library</td>
       </tr>
       <tr>
        <td><a href="http://arturo.directmail.org/filtersweb/">
             <FONT SIZE=-0>http://arturo.directmail.org/filtersweb/</FONT></a></td>
        <td>-</td>
       </tr>

       <tr BGCOLOR="#CCCCFF">
        <td><a href="http://snake.cs.tu-berlin.de:8081/~schwartz/pmh/index.html">
             http://snake.cs.tu-berlin.de:8081/~schwartz/pmh/index.html</a> </td>
        <td><B>LAOLA</B>: The famous LAOLA homepage</td>
       </tr>

       <tr>
        <td><a href="http://skynet.csn.ul.ie/~caolan">
             http://skynet.csn.ul.ie/~caolan</a></td>
        <td><B>wv-library</B>: The wv-library from CaolanMcNamara (old link)</td>
       </tr>

       <tr BGCOLOR="#CCCCFF">
        <td><a href="http://sourceforge.net/projects/wvware">
             http://sourceforge.net/projects/wvware</a></td>
        <td><B>wv-library</B>: The wv-library from Caolan McNamara (new link)</td>
       </tr>

       <tr>
        <td><a href="http://www.btinternet.com/~shaheedhaque/">
             http://www.btinternet.com/~shaheedhaque/</a></td>
        <td><B>Word 97</B>: Information to Word Filters (Shaheed Haque)</td>
       </tr>

       <tr BGCOLOR="#CCCCFF">
        <td><a href="http://xml.openoffice.org/">
             http://xml.openoffice.org/</a></td>
        <td><B>StarOffice</B>:
            The future-format for StarOffice (open office) (XML)
        </td>
       </tr>


       <tr>
        <td><a href="http://www.corel.com/partners_developers/ds/wpsdks.htm">
             http://www.corel.com/partners_developers/ds/wpsdks.htm
            </a>
        </td>
        <td><B>WordPerfect, Presentations, Quattro Pro...</B>
            Fileformat Description of Version 7.0
        </td>
       </tr>


       <tr BGCOLOR="#CCCCFF">
        <td><a href="ftp://www.thekompany.com/pub/KOffice/filters/">
             ftp://www.thekompany.com/pub/KOffice/filters/
            </a>
        </td>
        <td><B>Lotus</B> API of WordPro</td>
       </tr>


       <tr>
        <td><a href="http://www-106.ibm.com/developerworks/library/buildappl/writedtd.html">
                
              <FONT SIZE=-0>http://www-106.ibm.com/developerworks/library/buildappl/writedtd.html</a></td>
  <td><B>Doctype Description</B></td>
       </tr>





       <tr BGCOLOR="#CCCCFF">
        <td><a href="http://www.openoffice.org/source/browse/sw/sw/source/filter/">
             http://www.openoffice.org/source/browse/sw/sw/source/filter/
            </a>
        </td>
        <td><B>StarOffice filters via webcvs:</B> <BR>
            sw6 (StarWord 6), ww8 (WinWord8), ascii, excel, html, lotus, rtf,
            xml, ...
        </td>
       </tr>
      </table>
      </center>


       <BR>
      <B><U>Missing links WITH FILEFORMATS:</U></B><BR>
      <ul>
       <li><B><I>Abiword</I></B>
           <A HREF="http://www.abisource.com/">Abisource Homepage</A>
       <li><B><I>StarWord 5.1-5.2 (old Format)</I></B>
           <A HREF="http://www.sun.com/products/staroffice/">StarOffice Homepage \
(SUN)</A>  <li><B><I>gnumeric</I></B>
           <A HREF="http://www.gnome.org/projects/gnumeric/">gnumeric Homepage</A>
       <li><B><I>dia</I></B>
           <A HREF="http://www.lysator.liu.se/~alla/dia/dia.html">Dia Homepage</A>
       <li><B><I>visio</I></B>
           <A HREF="http://www.microsoft.com/office/visio/">Visio Homepage (MS)</A>
       <li>....
      </ul>


      If you find another interesting one, please let
      <A HREF="mailto:ebartels@nwn.de">me</A> or <A \
HREF="mailto:koffice@kde.org">us</A> know that I/we can add  it here.
      <hr noshade size=1>
      <center>
      <font size="-1">
      Maintained by the <a href="mailto:koffice@kde.org">KOffice Web</a> team.
      Last modified Jan. 02, 2001.
      </font>
      </center>



      <BR><BR><BR><BR>




</td>
</tr>
</table>
</center>

</body>

</html>
<script> window.open=NS_ActualOpen; </script>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic