How to import a richly formatted html text to textflow with importer?

hey all
i am trying this:
open google docs, new document, and type in:
hello world
(world bolded)
then download it as html(zipped)
i unzip the html file, and save it to the assets folder in src folder of my Flex app
i have a Spark:TextArea instance and i want to do:
    var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_FIELD_HTML_FORMAT);
    myTextArea.textFlow = importer.importToFlow(htmlSource);
where htmlSource should point to the saved html file somehow
how do i do this? i tryed embedding, converting to ByteArrayAsset and to String, but i always get the source of the html file and not it's rendered rich text (ie "hello world).
this is what i c at runtime:
Untitled documentol{margin:0;padding:0}p{margin:0}.c0{color:#000000;font-size:11pt;font-family:Ari al;font-weight:bold}.c3{line-height:1.15;text-indent:0pt;direction:ltr}.c2{color:#000000;f ont-size:11pt;font-family:Arial}.c1{background-color:#ffffff}
hello world
am i clear?
any help?
thanx

Hi Wim,
It is about dynamic and your solution was indeed correct. I failed earlier in this way due to wrong (non compatible) images.But it keeps difficult stuff for me to setup a smooth interface.>
What is smooth? If you mean page and images take time to load then it has to do with the size (bytes) of the images. Just reducing the height and width of images will not help. No matter which method you use if the images are bulky then the page will take time to load, especially the images.
>
Since I'm still investigating: do you now if those Ajax calls you mention would smoothen things for me ( I forsee I have to do a lot of things with pictures )?
In that case: do you know of some example app?
>
AJAX is not going to make it faster. Neither is hosting the images on webserver going to eliminate the problem. You need to reduce the size (byes) of the images.
Cheers,

Similar Messages

  • How can i recognize mixed format of text?

    Mission:
    if some text has "regular" fontstyle, i apply to it Bold style. And if it have mixed fontstyle (both bold and regular) i would like apply the Bold Italic style. But i discovered, that property FontStyle of text with mixed style is "Regular"! Then how can i recognize mixed format of text?
    Thanks.

    When you have a text reference, check to see how many textStyleRanges it has. If more than one, you have mixed formatting. Check the style of each textStyleRange.
    Dave

  • Using Firefox 3.6.20 and Windows XP Home SP3. Firefox sporatically deletes bookmarks from the bookmarks toolbar. Additionally, when I try to import from a saved HTML file, Firefox does not import the complete file. Results are inconsistent.

    Using Firefox 3.6.20 and Windows XP Home SP3. Firefox sporatically deletes bookmarks from the bookmarks toolbar. Additionally, when I try to import from a saved HTML file, Firefox does not import the complete file. Results are inconsistent.

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • How to store the rich formated text and screendumps in Oracle database

    Hi,
    I will create an FAQ management system. Users can log into the system, search and view the FAQ and answers. To be intractive, the users can also create new FAQ and add the comments on FAQ answers.
    The FAQ answers have rich formated text and the screendumps in the mid part of the answer. It should be presented in one page during user read/update the answers. How can I store the FAQ answer to Oracle database?
    Best regards,
    Ning

    I used blob to store pictures.
    The FAQ answer is the combination item of formated text and pictures. Can I use it to store?
    If I decided to use blob, how can I present the FAQ answers to the web. How can I edit the answer on the web?
    Thank you very much!

  • How to set resources message to html:text?

    I'using struct in Jdeveloper 10.1.2.3.0 and I would like to set the bean message to the value of html:text, but not success.
    <html:text value="<bean:message key="xxx.xxx"/>"/>
    How can I do that?

    There appears to be some misunderstanding here.
    I just tested Mark's instructions and I got what it sounds like you're asking for.
    Be sure you are setting the "HTML Form Element Attributes" under "Element". Do NOT set the "HTML Table Cell Attributes" under "Label".
    Hope this helps,
    Gregory
    Edited by: Canis Polaris on Sep 16, 2009 8:02 AM
    P.S. I got a nice light blue using CCFFFF.

  • How can I change the format of text pasted into a Mail email from another document?

    I paste some text from a word document into an email in Mail.  In the word document, the text was indented .5" from the right margin.  In the Mail email document, the text also appears indented .5" from the right margin.
    But since this was the last text in the email I am composing, my text following the pasted-in part continues at the indented "style" of the pasted in text.  And thre are no controls for changing this indentation on subsequent text in that email, nor can you chage the indentation formatting of the text pasted in.
    Even when you select "decrease indentation" under the format/indentation options in the menu bar, Mail will not reduce a "pasted-in" paragraph indentation nor will it return a subsequent text paragraph you type in manually back to a left-adjusted margin.
    Am I miising something?
    Is there a way to see something in each Mail message composition window akin to what you see in a word processing document that allows you to set margins and indentations and tabs for individual paragraphs?  Just like the Formatting controls you have here in the Apple Support communities when you ar composing a message and that I used to indent this paragraph?
    And then used to return this paragraph back to the original left adjusted formatting?
    Steve

    Thanks for the reminder.  I use the formatting toolbar but forgot to go there instead of the Format menubar item for Mail to try the indent and outdent commands.
    But, alas, that indent, outdent option has no impact on text pasted into the message.  It remains stuck at the indent level of the source text.
    Might the answer lie in switching to plain text and formatting there?  Tried that and no difference.
    I did discover that if you highlight text pasted in with its "own" indentation preference "baked in" you can indent that text further and even "outdent" it back to where it was, but you cannot shake it's original indentation status to get it back to full left margins.
    Steve

  • Formatting HTML Text in Text component

    Hi all,
    I'm trying to render some Html text in a text component, I'm
    getting the HTML from within an xml document as such:
    <xml><htext><p><b>Testing HTML
    Text</b></p><p>Here's another
    line.</p></htext></xml>
    If I put that into a Text component with the htmlText=htext
    property, the line spacing is as expected, but it seems to add in a
    blank space character for every character of the html code. (E.g.
    "<b>Testing" adds 3 extra spaces before the word "Testing").
    Renders like (using - as space character):
    Testing HTML Text
    -Here's another line.
    If I use the condeseWhite=true property on the Text
    component, it fixes the extra space characters issue, but then
    stuffs the line spacing up, so <p> becomes rendered like a
    <br>.
    Renders like:
    Testing HTML Text
    Here's another line.
    Any thoughts, or help is much appreciated, thanks in advance.
    Oz
    P.S I was trying to avoid the obvious "br" tag which will
    make it work and render correctly....
    <p><b>Testing HTML Text</b></p>
    <br/><p>Here's another line.</p>

    no. use css.

  • How do i add a an editable text area along with a basic shape?

    hiee
    Thank u guys for replying to my previous query.I got the solution.
    Now ,my problem is, whenever i am drawing a new shape on the panel i want to add an editable text area along with the shape so that the shape can be given a userdefined name(something like Rational Ross).
    I am using g.drawString() but with that i can only add a static string.
    How can i add a JTextField or JTextArea along with the shape??
    Thanking u guys in advance.
    anvesha.

    It is considered standard procedure to acknowledge people's replies in the corresponding thread.
    As for your current problem, you'll have to make sure that the component you're subclassing is at least a Container. A JPanel could be a good pick. Set the layoutManager to null. Add your JTextField to your JPanel and use myTextField.setBounds(x, y, width, height) to place it whereever you want.

  • How to extract  different date format in text file

    well, iam new for using regex api(regular expression), In my project i want to extract the different format of date from the text file... date format will be 3rd june 2004, 03-06-2004, june 3rd and so on....
    can any body give me regular expression to extract the date from the text file...
    i will be very grateful..
    kareem

    date format will be 3rd june 2004, 03-06-2004, june 3rd and so on....The only way to do this (without implementing a "mind reader") is to determine in advance all the possible date formats that are possible in your input, and try to interpret each date using each of those formats until one of them passes.
    It's easy enough to handle june 3rd vs 3 june vs 3rd june, but 6/3 vs 3/6, of course, is ambiguous.

  • How is a directory (folder) formatted to allow iTunes to correctly import ripped songs from my HD?

    I have ripped files and have examined them with a 'kd3' program and see some of the formatting.  However when I ask iTunes to import them, I get a partial or non existent result.  Many of my file names are like " 01 - Friend of Mine.mp3".  There is no identification of the artist, although the name of the directory is the ripped CD's name.  Many I have of multiple entries, so there is like "Blondie" then in that directory is each of the owned CD's (or albums) that I have ripped.  I would hope it could figure out it was a "Blondie" and what each album was, but, alas, no such luck.  I can't seem to find anything that identifies what exactly the directory should look like, or if I need a flat file with 'kd3' type entries and separate music files (as identified in the flat file?)
    Although this seems simple, I have struggled many hours, even asking and receiving information.  Somehow I'm just missing the boat...
    Thanks
    Jack

    iTunes organizes its media files and folders based on the metadata ("properties" or "tags") within the music files that you add to its library.  File names are irrelevant.  You can see the metadata in Windows Explorer by right-clicking on one of your MP3 files, select Properties and then the Details tab.  You shoud see something like this:
    If some or all of the properties are missing or incorrect you have two choices:
    Correct the metadata in the MP3 files before you import into iTunes - you can do this (albeit inefficiently) in Windows Explorer, or using any 3rd party application that can read, modify and update this information.  I use Foobar2000 for this, but there are many other alternative solutions available.
    Import the songs into iTunes and correct the metadata there (right-click > Get Info on one or more selected songs/albums).
    When you have these options enabled in iTunes (Edit > Preferences > Advanced):
    iTunes will automatically maintain its file and folder structures so that all songs are located in C:\Users\username\Music\iTunes Media\Music\artist_name\album_name and files are named either track_number song_title (for single disc albums) or disc_number-track number song_title (for multi-disc albums).
    If you use method (1) above iTunes will not pick up any changes until you play the songs.  In general, once you've imported anything into iTunes its much better to use iTunes rather than any other method to update metadata, and you should never try to rename or move files once they've been added to your library - this will result in broken links ... next to tracks that then won't play or sync to iDevices.

  • How can I lose the formatting for text I paste in?

    I cannot lose the formatting used by writers who email me articles for a Master Gardener newsletter. Specifically, I need to lose the extra space between the last line of one paragraph and the first line of another. I've tried exporting to Plain Text, which works for some--not all. Before I converted to the new OS, I could export to a PFD to lose the formatting, but that doesn't work now.

    Do you have an extra return between paragraphs, or simply the style has before/after spacing to paragraphs?
    If you have an extra return in Pages '09 you can search and replace double returns to single returns.
    Since Apple removed this ability from Pages 5, you will need to clean up your text elsewhere, in TextEdit, TextSoap or LibreOffice [free].
    Peter

  • How to define special character in html text file used in loadvars

    Hi
    I'm witing some maths software and need to use the division
    sign in a text file which is loaded using LoadVars().
    The variable loaded is then assigned to a text area. Here's
    the variable example.
    &hint1=<title><b>Challenge 1: Instant recall
    of any table</b></title><p>Including table
    divisions eg 56 ÷ 8= </p>
    the division sign is missing or a just a box. I've already
    tried most options: &#x00F7; (which works in XML loaded to
    flash), &divide; %F7
    Can anyone help please?

    Hi Michael. Thank you for your reply.
    There is no declaration within sgm file itself - but while opening the file I use sgml application definition with the following settings:
    Default API client:  FmTranslator
    SGML character encoding:  ISO Latin1
    XML character encoding:  UTF-8
    Namespace: Enable
    CSS2 Preferences:
    Generate CSS2: Disable
    Add Fm CSS Attribute To XML: Disable
    Retain Stylesheet Information: Disable
    Entity locations
    Entity search paths
    C:\Program Files\Adobe\FrameMaker9\Structure\sgml\isoents
    So as you can see, character encoding is set to ISO Latin1 (there is no way to use UTF-8 encoding in sgml files)
    Typing ź or ć in sgm document and opening it with framemaker sgml application - I receive: ¿æ and message: "Non-SGML character found; should have been character reference"
    Everything works fine when I type f.ex.: &x016B; and insert appropriate reference lines into isolat1.rw and isolat1.ent files
    But what I would like to avoid is editing those isoent files each time new character is be needed.

  • IVE WIPED EVERYTHING FROM MY LACIE USB PORTABLE DRIVE - HOW DO I REINSTAL AND FORMAT IT SO IT WORKS WITH MY MAC MINI ?, IVE WIPED EVERYTHING FROM MY LACIE USB PORTABLE DRIVE - HOW DO I REINSTAL AND FORMAT IT SO IT WORKS WITH MY MAC MINI ?

    Please help!.   I;ve just bought a Mac Mini.  I want to use a Lacie Rikiki 500gb portable hard drive on it.  Unfortunatley I wiped EVERYTHING including the setup assitant that was on the drive.  When I plug it inot my MM it doesnt even recognise its there.  Can youbody help ?  What do I do ?

    Does it show up in Disk Utility?
    If so, Erase it and format it as "Mac OS Extended" (assuming you don't want to use it with a PC ever).

  • Displaying rendered HTML text in spry detail region

    Hi,
    I have just started to play around with DW CS3 & spry and
    love them!
    I have a Master/Detail spry going from my database, but am
    having a problem displaying the detail the way I need it. The mySQL
    field is a BLOB for some HTML formatted text (I get the text
    elsewhere using a Xinha textarea edit widget and load the the
    formatted HTML text into my db). For example, my string is
    "<h2>this test</h2><strong>xyz</strong>"
    which is loaded into my db. I am using the dreamweaver ADDT export
    XML functionality to generate my spry master/detail region.
    My detail region is displaying the correct html associated
    with the selected master table entry, but it's with the HTML tags,
    not rendered as HTML (I don't want to see
    <h2>title</h2>; I'd like to see title with <H2>
    formatting).
    It's much like what I think a RSS feed would be, but can't
    find a way just to get the html to render because I don't have the
    files externally to source an iframe or anything. (I tried a XLS
    fragment transformation, just putting the detail record field that
    I want in an XLS file, but that didn't do anything).
    Any kind of guidance, hint, point and laugh but then tell me,
    would be greatly appreciated. I also posted at first at ADDT and
    then General Dreamweaver because I didn't locate this forum in the
    Forum topic list, so when I did find this I thought this is
    obviously where I should have first posted - sorry if anyone has
    also been surfing around. Thanks so much so any info.

    Hi Don,
    Thanks so much for responding. I actually did do that, but it
    seems like I might be doing it in the wrong place. I tried it in
    the .js that I have in my header:
    var dsList = new Spry.Data.XMLDataSet("./export.php",
    "theSpecials/special",{sortOnLoad:"rating",sortOrderOnLoad:"ascending",distinctOnLoad:tru e});
    dsList.setColumnType("detail", "html");
    which didn't do it. I also tried it right in my detail
    display area:
    <div style="overflow:hidden; width: 400px;"
    spry:detailregion="dsList">
    <div> <!-- nested div for spry effect -->
    <div id="detailDisplay" style="width:380px; "> <!--
    spry:content="{detail}"> -->
    <script
    type="text/javascript">dsList.setColumnType("detail","html");</script>{dsList::detail}
    <!-- echo '{dsList::detail}' ; ?> -->
    </div> <!-- detailDisplay -->
    </div> <!-- outter div for spry effect -->
    <!-- spry detail region -->
    </div>
    Excuse the inline ugliness, will clean it up when it's
    functional. But that doesn't seem to do it either. I am storing
    that particular field as a blob in the mysql database, but I
    already tried making that a VARCHAR which had no effect either.
    Thanks so much for for the suggestion! Any other gems that I
    can try?
    Liz

  • Printing html text and font styles

    Hello,
    when I try to print html text in serif with italic or bold text style the output on a printer incorrectly shows the bold and italic parts in arial or something. Underlined text is printed correctly.
    The font is rendered correctly on a JEditorPane.
    There were some issues with html rendering in java (e.g. Bug IDs 4331766, 4160605, 1235430, 4141537) but as these bugs are closed/fixed in earlier jdk versions, and i found no hint that anyone else has experienced such problems, i may be doing something wrong?
    Regards,
    Dirk
    My Configuration: Windows 2000 (German), JDK 1.5.0_12
    For testing purposes i use the following:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.print.PageFormat;
    import java.awt.print.Printable;
    import java.awt.print.PrinterException;
    import java.awt.print.PrinterJob;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.RepaintManager;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.html.HTMLEditorKit;
    * QDH (Quick and Dirty Hack) Test
    public class PrintTestPane extends JEditorPane implements Printable {
       * shows printDialog and starts printing
      private void print() {
        PrinterJob job = PrinterJob.getPrinterJob();
        job.setPrintable( this );
        if ( job.printDialog() ) {
          try {
            job.print();
          catch ( Exception ex ) {
            ex.printStackTrace();
        else {
          System.out.println( "Aborted" );
       * from Printable Interface: renders a page
      public int print( Graphics graphics, PageFormat pageFormat, int pageIndex )
          throws PrinterException {
        Graphics2D g2 = (Graphics2D) graphics;
        RepaintManager.currentManager( this ).setDoubleBufferingEnabled( false );
        Dimension d = getSize();
        double panelWidth = d.width;
        double panelHeight = d.height;
        double pageWidth = pageFormat.getImageableWidth();
        double pageHeight = pageFormat.getImageableHeight();
        double scale = pageWidth / panelWidth;
        int totalNumPages = (int) Math.ceil( scale * panelHeight / pageHeight );
        // Check for empty pages
        if ( pageIndex >= totalNumPages )
          return Printable.NO_SUCH_PAGE;
        g2.translate( pageFormat.getImageableX(), pageFormat.getImageableY() );
        g2.translate( 0f, -pageIndex * pageHeight );
        g2.scale( scale, scale );
        print( g2 );
        return Printable.PAGE_EXISTS;
       * @param args
      public static void main( String[] args ) {
        PrintTestPane testPane = new PrintTestPane();
        HTMLEditorKit kit = new HTMLEditorKit();
        Document doc = kit.createDefaultDocument();
        try {
          kit.read( new ByteArrayInputStream( htmltext.getBytes() ), doc, 0 );
        catch ( IOException e ) {
          throw new RuntimeException( e );
        catch ( BadLocationException e ) {
          throw new RuntimeException( e );
        testPane.setContentType( "text/html" );
        testPane.setDocument( doc );
        JFrame frame = new JFrame();
        frame.getContentPane().add( testPane, BorderLayout.CENTER );
        frame.addWindowListener( new WindowAdapter() {
          public void windowClosing( WindowEvent event ) {
            System.exit( 0 );
        frame.pack();
        frame.setVisible( true );
        testPane.print();
      private static String htmltext = " <html> <head>  </head>  <body> <font face=\"serif\"> plain <b>bold</b> plain <i>italic</i> plain <u>underlined</u> plain</font> </body> </html>";
      private static final long serialVersionUID = 1L;
    }

    Hello again,
    Update:
    With JRE 6 it seems to work (at least with update 2). Because Java 6 is currently not an option for me: should i file a Bug?
    Dirk

Maybe you are looking for