User Tag List

Results 1 to 4 of 4

Thread: RTF to HTML - Need Help!

  1. #1
    Clicker Fusion 2.5 (Steam)

    Join Date
    Dec 2018
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RTF to HTML - Need Help!

    Hi!

    I made this "auto-text" software to help me with my reports. Itīs use RTF text and works like a charm with RTF text based software (LibreOffice, Word...). Unfortunately, sometimes I have to use HTML based text processor and itīs breakes all the rich text elements. I realized that software like LibreOffice and Microsoft Word create a HTML type clipboard content, so it keeps the Rich Text elements when you copy / past to a HTML text box.

    I found an alternative solution using the WebView Object. Just made a simple HTML code with javascript to copy the text content in a DIV and Fast Loop and String Replace Object for each sentence. Unfortunately, the user have to manualy set if the text have a title or a footer note line with a diferent style of the rest of the text (center, bold, italic). It donīt track/scan every paragraph.

    Iīm trying to solve this problem making a simples automatic RTF to HTML converter, like Word and LibreOffice. But, I canīt figure out how...

    Something like:

    Open RTF text on Rich Text Object:

    Title

    Paragraph1
    Paragraph2
    Paragraph3
    Paragraph4

    footer note


    Turn something like:

    <head>
    Content...
    <head>
    <body>
    <P style="color: black; text-align: center; font-family:arial; font-size: 11pt; font-weight: bold; text-decoration: underline; font-style: none;">Title</P>
    <br>
    <P style="color: black; text-align: justify; font-family: Arial, sans-serif; font-size: 11pt; font-weight: none; text-decoration: none; font-style: none;">Paragraph1</P>
    <P style="color: black; text-align: justify; font-family: Arial, sans-serif; font-size: 11pt; font-weight: none; text-decoration: none; font-style: none;">Paragraph2</P>
    <P style="color: black; text-align: justify; font-family: Arial, sans-serif; font-size: 11pt; font-weight: none; text-decoration: none; font-style: none;">Paragraph3</P>
    <P style="color: black; text-align: justify; font-family: Arial, sans-serif; font-size: 11pt; font-weight: none; text-decoration: none; font-style: none;">Paragraph4</P>
    <br>
    <P style="color: black; text-align: justify; font-family: Arial, sans-serif; font-size: 11pt; font-weight: none; text-decoration: none; font-style: italic;">bottom note</P>


    And then load to WebView Object.


    I tryed to make a "line by line" scan with FastLoop, but I was not very successful.

    May someone help me with some ideas?

  2. #2
    Clicker Fusion 2.5 (Steam)

    Join Date
    Dec 2018
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For addicional information, this is how the example was copy to clipboard with LibreOffice:

    Version:1.0
    StartHTML:0000000168
    EndHTML:0000001107
    StartFragment:0000000485
    EndFragment:0000001090
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
    <TITLE></TITLE>
    <META NAME="GENERATOR" CONTENT="LibreOffice 3.6 (Windows)">
    <STYLE TYPE="text/css">
    <!--
    @page { margin: 2cm }
    P { margin-bottom: 0.21cm; so-language: zxx }
    -->
    </STYLE>
    </HEAD>
    <BODY DIR="LTR">
    <P LANG="zxx" ALIGN=CENTER STYLE="margin-bottom: 0cm; font-style: normal">
    <U><B>Title</B></U></P>
    <P LANG="zxx" ALIGN=CENTER STYLE="margin-bottom: 0cm"><BR>
    </P>
    <P LANG="zxx" ALIGN=JUSTIFY STYLE="margin-bottom: 0cm">Paragraph 1</P>
    <P LANG="zxx" ALIGN=JUSTIFY STYLE="margin-bottom: 0cm">Paragraph 2</P>
    <P LANG="zxx" ALIGN=JUSTIFY STYLE="margin-bottom: 0cm">Paragraph 3</P>
    <P LANG="zxx" ALIGN=JUSTIFY STYLE="margin-bottom: 0cm">Paragraph 4</P>
    <P LANG="zxx" ALIGN=JUSTIFY STYLE="margin-bottom: 0cm"><BR>
    </P>
    <P LANG="zxx" ALIGN=JUSTIFY STYLE="margin-bottom: 0cm"><I>Footer
    Note!</I></P>
    </BODY>
    </HTML>

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProFirefly 3D Module
    twister's Avatar
    Join Date
    Jan 2007
    Location
    Pacific Northwest USA
    Posts
    323
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You might try using the list object and do a line by line extraction, pasting into an rtf object, then use rtf find and replace, then copy that and paste into a final rtf?

  4. #4
    Clicker Fusion 2.5 (Steam)

    Join Date
    Dec 2018
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    More one day of work and, well.. this is the far I can get.

    RTF to HTML 2.zip

    Just click on "Click 1" and"Click 2" to watch the magic happens.

    Itīs not perfect, but I think iīm on the way.

    I needed to use the "SlowLoop Object" because the itīs doesnīt works with fastloop.

    May someone help improve this?

Similar Threads

  1. Replies: 2
    Last Post: 10th January 2017, 09:47 AM
  2. HTML?
    By xhedgehogx in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 26th July 2010, 03:49 PM
  3. About html
    By Keli in forum Vitalize
    Replies: 1
    Last Post: 9th December 2007, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •