We're building a brand new version of the site, and we'd love to hear your ideas
Members
Technology Zones
IBM Learning Center
Articles
Hosted By
Info
|
[180] Convert RTF to HTML
Last post 08-05-2005 8:43 PM by shovmyfist. 37 replies.
-
Advertisement
|
|
-
-
-
-
-
-
pleitch


- Joined on 07-09-2002

- Points 60
|
Although the colour section worked perfiectly well, it was a bit messy. Here is a reword of that function:
Function GetColorTable(strSecTmp As String, strColorTable() As String)
Dim i As Integer
'get font table data and fill in strFontTable array
'We can turn the whole thing into an aray, based of ";", where we ignore the first and last item.
ReDim strColorTable(CInt(UBound(Split(strSecTmp, ";")) - 2)) As String
For i = 1 To UBound(Split(strSecTmp, ";")) - 1
'We only want the section from the first space to the end....using ";}{" as an array splitter
strColorTable(i - 1) = GetColor(CStr(Split(strSecTmp, ";")(i)))
Next i
End Function
Function GetColor(ByVal ColourSection As String) As String
Dim strRed As String
Dim strGreen As String
Dim strBlue As String
strRed = Hex(CByte(Right(Split(ColourSection, "\")(1), Len(Split(ColourSection, "\")(1)) - 3)))
If Len(strRed) = 1 Then strRed = "0" & strRed
strGreen = Hex(CByte(Right(Split(ColourSection, "\")(2), Len(Split(ColourSection, "\")(2)) - 5)))
If Len(strGreen) = 1 Then strGreen = "0" & strGreen
strBlue = Hex(CByte(Right(Split(ColourSection, "\")(3), Len(Split(ColourSection, "\")(3)) - 4)))
If Len(strBlue) = 1 Then strBlue = "0" & strBlue
GetColor = "#" & strRed & strGreen & strBlue
End Function
|
|
-
-
Confuzer


- Joined on 08-30-2002

- Points 5
|
Types do not match question?
Hey,
I tried to use your code, but am quite new to asp and got this error:
Runtimeerror Microsoft VBScript (0x800A000D)
Types do not match: 'rtf2html'
I try to implement it like this:
<%=rtf2html("blaat", "+H")%>
and I put the code in rtf2html.inc wich I include on top of the page I load...
I am making a stupid mistake so please correct me
Greetz,
Rutger
|
|
-
-
-
-
-
Shadowstalker


- Joined on 11-13-2002

- Points 10
|
hi!
i'll give you a tip in html character codes (well, if you like to extend it...) , why don't you try to look for the html codes in some sites (example, your code in your "select case" statement inside HTMLCode) and try to place it in a "for - next" statement. just get the sequence of the bytecode and try to make a formula to make it more faster and easier for the compiler... even though its my first time to register here in developer fusion, i've got a lot of experiences in programming languages: HTML, ASP, Javascript, VB, C++ (native one), SQL... but at least i tried to help you optimize your code. any help you need from me or tips to give to me, just e-mail me here at eight_bytes@yahoo.com
|
|
-
-
-
-
vtbinh


- Joined on 12-26-2002

- Points 5
|
Convert Window-1252 to UTF-8
How can I convert html file from charset window-1252 to UTF-8?
You can help me with dll
Thanks
|
|
-
|
Search
Code Samples
New Members
|