[lug] html to rtf

Michael J. Hammel mjhammel at graphics-muse.org
Sun Dec 10 11:47:02 MST 2000


Thus spoke D. Stimits
> Just wondering which version of Applix you have. I have Applix, but
> haven't used the rtf or html features.

I managed to convert all the HTML to RTF's using Applix's ELF macros.  You
can run these on the command line (in most cases, I think).  Anyway, it
turns out the macro was pretty simple.  It just took me a loooong time to
find the write macros to use.  Just drop the following macro into
"html2rtf.am" in your axhome/macros directory.  To run it on the command
line you run

   applix -call html2rtf <filename>

Don't include the "html" extension on the filename.  The macros just needs
the basename of the file.  Note that this macro leaves a file called
"newfile.aw" hanging around.  I didn't look up how to remove the file from
the macro - I just handled the cleanup process in a shell script.  Also,
this macro produces an error to stdout (or stderr) that I don't know how to
deal with - but it doesn't seem to affect processing.


MACRO html2rtf(filename)

VAR infile, outfile

   infile = filename ++ ".html"
   outfile = filename ++ ".rtf"

   SET_MACRO_PARENT_TASK@(0)
   SUPPRESS_INFO_MESSAGES@(TRUE)
   FILTER_HTML_TO_WP@(infile, "newfile.aw")
   FILTER_WP_TO_RTF@("newfile.aw", outfile, TRUE)
   LOGOUT@()

ENDMACRO


-- 
Michael J. Hammel           |
The Graphics Muse           |       I respect strong willed women and
mjhammel at graphics-muse.org  |       strongly will for respectable women.
http://www.graphics-muse.com 




More information about the LUG mailing list