| View previous topic :: View next topic |
| Author |
Message |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Wed Oct 19, 2005 7:54 pm Post subject: Convert RTF to HTML [RESOLVED] |
|
|
Anyone know of a free DLL or command line program that can convert an RTF doc to HTML?
Thanks _________________ Chris
Http://theblindhouse.com
Last edited by LiquidCode on Wed Oct 19, 2005 9:26 pm; edited 1 time in total |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Thu Oct 20, 2005 1:04 am Post subject: |
|
|
Could ya share the bounty? _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Thu Oct 20, 2005 6:38 am Post subject: |
|
|
Try this Chris::
| Code: |
REM This script demonstrated how to use r2h.dll, an
REM application extension to convert rich text documents to
REM html format.
REM This sample assumes that r2h.dll resides in the same path
REM as this script.
title VDS Rtf2Html
option scale,96
option decimalsep,"."
DIALOG CREATE,VDS Rtf2Html,-1,0,335,95,
REM *** Modified by Dialog Designer on 10/20/05 - 02:01 ***
dialog add,TEXT,txt1,10,10,200,15,Select RTF file to convert:
dialog add,EDIT,ed1,25,10,200,20
dialog add,BUTTON,btn1,25,220,30,20,...
dialog add,TEXT,txt2,50,10,200,15,Save converted file as:
dialog add,EDIT,ed2,65,10,200,20
dialog add,BUTTON,btn2,65,220,30,20,...
DIALOG ADD,BUTTON,Convert,15,260,65,25,Convert
DIALOG ADD,BUTTON,Cancel,45,260,65,25,Cancel
dialog show
:Evloop
wait event
%E = @event()
goto %E
:btn1BUTTON
%z = @filedlg("Rich text files (*.rtf)|*.rtf")
if @not(@null(%z))
dialog set,ed1,%z
dialog set,ed2,@path(%z)@name(%z).html
dialog enable,Convert
dialog focus,Convert
end
goto Evloop
:btn2BUTTON
%z = @filedlg("Html files (*.html)|*.html",Save as...,,SAVE)
if @not(@null(%z))
dialog set,ed2,%z
if @null(@dlgtext(ed1))
dialog focus,ed1
dialog disable,Convert
else
dialog focus,Convert
dialog enable,Convert
end
end
goto Evloop
:ConvertBUTTON
%%rtf = @dlgtext(ed1)
%%html = @dlgtext(ed2)
%%imgsDir = @path(%%html)@name(%%html)
loadlib @path(%0)r2h.dll
if @ok()
REM INT Convert(char *rtf, char *html, ULONG Flags, char *imgsDir)
REM Parameters description::
REM char *rtf - String that contains the filename of a rich
REM text file to convert.
REM char *html - String that contains the filename to save
REM the converted file to.
REM ULONG Flags - the following values can be ORed together
REM for specifying required flags:
REM 0 - No flags
REM 1 - Use image size -> not sure what this
REM means.
REM 2 - Use image directory -> If used, will
REM create a directory for storing images
REM embedded within the html document
REM 4 - PreferUnicode -> Not sure what this
REM means.
%%result = @lib(@path(%0)r2h.dll,Convert,INT:,STR:%%rtf,STR:%%html,2,STR:%%imgsDir)
if @zero(%%result)
shell open,%%html
end
freelib @path(%0)r2h.dll
end
goto Evloop
:CancelBUTTON
:CLOSE
exit
|
_________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Oct 20, 2005 11:58 am Post subject: |
|
|
I used the RTF2HTML dll a while back. Unfortunately it proved to be a little unreliable - for some files it worked
just great, for others the output was no good.
By far the best command-line converter I've used was RTFtoHTML by Chris Hector. I think that one has
gone over to Logictran and renamed to R2Net - and has become quite expensive.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Oct 20, 2005 3:35 pm Post subject: |
|
|
Thanks Bill! I'll give it a try tonight.
Thank for the tip Dread, I'm going to give it a go and see how it works out. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|