[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RTF to HTML Conversion

Chirag Patel

6/29/2007 12:55:00 PM

i having document upload facility on my web page.
for word doc its working perfect.
for that we are converting doc to html using win32OLE and storing it in
DB.
while disply just showing it on web page.
But i am not be able to convert RTF file into HTML using Win32OLE.

is there any way to do it through Ruby Code??

RTF to HTML Conversion???

--
Posted via http://www.ruby-....

3 Answers

Axel Etzold

6/29/2007 1:45:00 PM

0

Dear Chirag,
> But i am not be able to convert RTF file into HTML using Win32OLE.
>
> is there any way to do it through Ruby Code??
>
> RTF to HTML Conversion???

I am not sure about Ruby Code, but maybe you can do this using
wvware or abiword:

wvware.sourceforge.net

Best regards,

Axel
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/g...

vasudevram

6/29/2007 7:01:00 PM

0

On Jun 29, 6:44 pm, "Axel Etzold" <AEtz...@gmx.de> wrote:
> Dear Chirag,
>
> > But i am not be able to convert RTF file into HTML using Win32OLE.
>
> > is there any way to do it through Ruby Code??
>
> > RTF to HTML Conversion???
>
> I am not sure about Ruby Code, but maybe you can do this using
> wvware or abiword:
>
> wvware.sourceforge.net
>
> Best regards,
>
> Axel
> --
> GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
> Alle Infos und kostenlose Anmeldung:http://www.gmx.net/de/g...

Try this - it may work, haven't checked it out:

Control Word programmatically via Ruby using the win32ole library, as
follows:

- open the RTF file in Word (you may have to tweak the Open dialog to
set the File Type field to RTF, since the default is DOC)
- use the Save As option of Word to save it as HTML

For details, check out the good examples of controlling Word via Ruby
on David Mullet's RubyOnWindows blog. Here's a link to the Word
section:

http://rubyonwindows.blogspot.com/search/...

- Vasudev Ram
Biz site: http://www.dancin...
Blog on software innovation: http://jugad.livej...
PDF creation/conversion toolkit: http://sourceforge.net/proje...


Kyle Schmitt

6/29/2007 7:21:00 PM

0

RTF is a text file, with a bunch of controls encased in the likes of
curly brackets {}

Lookie here for general info
http://en.wikipedia.or...

At the bottom you'll find links to UnRTF(a gnu c app to convert rtf to
html etc), a ruby RTF library
(http://ruby-rtf.rubyforge.org/docs/... mostly for creating,
but you never know), and lots of specs of the RTF format.

If you were so inclined, it would take (this is a guess here) between
10 and 30 regular expressions to create your own RTF to HTML method.
Heck if you just wanted the basics, probably 5 would do: 4 for style,
1 to strip everything you don't want to worry about.

Because frankly, automating word excel and power point sucks. It's
easy to get orphaned processes lying around that way, and they suck up
an inordinate amount of ram for what you're using it for. Office
automation is ok for single users only, it's barely acceptable for
build servers and test servers (where I've had the most experience
with it), and it's a completely unsuitable option for a production
website.

--Kyle