How to convert HTML text to image

Hi all!
I´m having this problem: I have a html code (dynamic generated) and I need to convert it to a image, any idea how to do that?
Thanks, J.

Im no Java2D expert but if you want the actual code as an image couldnt you just use 'drawString("<br>", x, y)' to display it and then allow it to be saved as an image, I know theres built in capability in Java to import/export common image formats. Or do you mean you want what the html actually produces as an image?
Ken

Similar Messages

  • How to Display Html Text with Image

    HI Frens,
    I am getting some html text from a source, Later i want to
    display that data, but it may happened that it has some images in
    it. Currently I am using text area to display it.
    Now My question is if there is any image will it show, as we
    can see it in our mails? if Not, Which component I should use for
    this?
    I also want that I need to select some file from, How can i
    get open dialog box here?
    Thks in Advance for replies frens:
    Ashish Mishra

    Hi Ashish,
    If I have understood your requirement properly, u want to
    display html text on a flex application.
    I think there its better if you use the html component to
    display the text. I have a sample code which will give you a
    direction to think on.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    creationComplete="initApp( )">
    <mx:Script>
    <![CDATA[
    public function initApp( ):void
    var initHtml:String = "<html><head> \
    <title='Page Example'/> \
    <body bgcolor='#ccddee'><h1>Page
    Example</h1> \
    <p>This is a complete <b>HTML</b> \
    page as a
    <em>string</em>.</p></html></body>";
    this.html.htmlText = initHtml;
    ]]>
    </mx:Script>
    <mx:HTML id="html" width="100%" height="100%" />
    </mx:Application>
    Also do you want a file open dialog box??

  • How to convert simple text to image

    Hi,
    I needed to secure web form from automated form submission. Looking into some common website, they use image displaying random text, which is only readable by user. So the automated form submission can be avoided.
    I checked through lot of forum, but could not find help in doing it using java. So is there something in java api using which i can generate image of fly for each request by passing some random generated text of about 5-6 character length.
    Any help on this would be appreciated...
    Thanks,
    Naresh

    hi ican convert image ti html
    coding---------------
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import java.awt.event.*;
    public class img2html extends Frame
         static Image im=null;
         static int W=-1,H=-1;
         public img2html()     {}
         public static void main(String args[])
              String infile,outfile;
              infile="c:\\micky.jpg";
              outfile="c:\\micky.html";
              boolean paramsOK=false,mode=false;
              //if (args.length <= 1) {
              //     usage();
              //     paramsOK=false;
         //     if (args.length == 2) {
              //     infile = args[0];
              //     outfile = args[1];
                   paramsOK=true;
              if (paramsOK) {
                   //System.out.println("img2html :");
                   System.out.println(" image file " + infile);
                   System.out.println(" data file " + outfile);
                   img2html widow = new img2html();
                   System.out.println("img2html : Loading image file");
                   if (widow.processFile(infile)==false) {
                        System.exit(0);
                   //System.out.println("img2html : Saving data file");
                   saveByteData(outfile,mode);
                   System.exit(0);
         public static void saveByteData(String fn,boolean i)
              int[] grabMapXY;
              grabMapXY          =      new int[(W * H)];
              int pix;
              PixelGrabber pg = new PixelGrabber(im,0,0,W,H,grabMapXY,0,W);                
    //     PixelGrabber pg =
    // new PixelGrabber(image, 0, 0, -1, -1, false);
              // start grab
              try {
                   pg.grabPixels();
              } catch (InterruptedException e) {
                   System.out.println("Map grab failed : " + e);
                   return;
              if ((pg.status() & ImageObserver.ABORT) != 0) {
                   System.out.println("Map grab failed !");
                   return;
              // need to base r on number of valid pixels
              writeToFn(fn,"<HTML>");
              writeToFn(fn,"");
              writeToFn(fn,"<BODY>");
              writeToFn(fn,"");
              writeToFn(fn,"<TABLE border=0 cellspacing=0 cellpadding=0>");
              int red,green,blue,p;
              String r,g,b;
              Color c;
              for (int y =0; y < H; y++) {     
                   writeToFn(fn," <TR>");
                   for (int x =0; x < W; x++) {
                        pix=grabMapXY[ y * W + x ];
                        c = new Color(pix);
                        red=c.getRed();
                        blue=c.getBlue();
                        green=c.getGreen();
                        r=Integer.toHexString(red);
                        g=Integer.toHexString(green);
                        b=Integer.toHexString(blue);
                        if (r.length()==1) { r="0"+r; }
                        if (g.length()==1) { g="0"+g; }
                        if (b.length()==1) { b="0"+b; }
                        writeToFn(fn," <TD WIDTH=1 HEIGHT=1 BGCOLOR=#" + r + g + b + ">", " " + x + "," + y + " - of - " + W + "," + H);
                        writeToFn(fn," </TD>");
                   writeToFn(fn," </TR>");
              writeToFn(fn,"");
              writeToFn(fn,"</TABLE>");
              writeToFn(fn,"");
              writeToFn(fn,"</BODY>");
              writeToFn(fn,"</HTML>");
         public static void writeToFn(String fn,String Dbytes,String status) {
              try {
                   //System.out.println(Dbytes + " pixel " + status);
                   DataOutputStream dos = new DataOutputStream( new FileOutputStream(fn,true));
                   dos.writeBytes(Dbytes); //
                   dos.writeByte(13); // line feed for each line
              dos.writeByte(10); // line feed for each line
                   // close here
                   dos.close();
              } catch (IOException e) {
                   System.err.println("File error: " + e.getMessage());
         public static void writeToFn(String fn,String Dbytes) {
              try {
                   //System.out.println(Dbytes );
                   DataOutputStream dos = new DataOutputStream( new FileOutputStream(fn,true));
                   dos.writeBytes(Dbytes); //
                   dos.writeByte(13); // line feed for each line
              dos.writeByte(10); // line feed for each line
                   // close here
                   dos.close();
              } catch (IOException e) {
                   System.err.println("File error: " + e.getMessage());
         public boolean processFile(String fn)
              boolean OK=false;
              int exitcounter;
              try {
                   im = getToolkit().getImage(fn);
              catch (Exception e)
                   System.out.println("1HOLY MOLY THIS NEVER HAPPENS!!!! "+e);
              MediaTracker tracker= new MediaTracker(this);
              tracker.addImage(im,0);
              try {
                   tracker.waitForID(0);
              catch (InterruptedException e)
                   System.out.println("2HOLY MOLY THIS NEVER HAPPENS "+e);
              if (tracker.isErrorID(0)) {
                   System.out.println("IMAGE FILE COULD NOT BE LOADED");
                   System.out.println(fn);
              } else {
                   exitcounter=0;
                   while ( ((W==-1)||(H==-1)) && (exitcounter<=16000000) )
                        W=im.getWidth(null);
                        H=im.getHeight(null);
                        exitcounter++;
                   if (exitcounter>15999999)
                        System.out.println("Timeout attempting to load image, is it to big?");
                   else
                        OK=true;
              return(OK);
         public static void usage() {
              //System.out.println("Usage:");
              //System.out.println("java img2html infile outfile ");
              //System.out.println(" infile : image file .gif ");
              //System.out.println(" outfile : html file to be created");
              //System.out.println(" /i : Inverse data ");
    }     // end of class

  • Sorry about first try : how to avoid html-text tag converting & to & amp;

    subject
    how to avoid html:text tag converting "&" to "& amp;"?
    body
    hi,
    i have some values on DB like "& #351;" and when i use html:text to
    show binding's value, html:text converts "&" to "& amp;". in generated
    html, it looks like "& amp;#351;".
    how to avoid this conversion?
    thanks...
    Ayhan G�ng�r
    note: i use white-space among special characters because browser renders them. ex : (& amp; to &)

    hi, i use property attribute of html:text.
    property is declared in UIModel xml file.
    i mean, i don't use something like
    <html:text value="data"/>i use just like
    <html:text property="bindingName"/>and value is shown in generated html input tag as value.
    html:text has no attribute like filter.
    i think i should override html:text tag, and create a new tag that checks if value includes "& #351;" this type data. If there is, don't convert "&" to "& amp;"?
    any suggestions?
    thanks...
    Ayhan

  • How to send HTML mail with images multipart/related message

    Hi,
    Could any body tell me how to send HTML mail with images in "multipart/related" message,if any body can give the code ,it would be helpful.
    Thanks

    Hi,
    Could any body tell me how to send HTML mail with
    ith images in "multipart/related" message,if any body
    can give the code ,it would be helpful.
    ThanksHi!
    Refer to
    http://developer.java.sun.com/developer/onlineTraining/JavaMail/index.html
    I've found it very helpful.
    Look at the last part for a code showing how to send HTML mail!
    Regards

  • How to invoke alt-text for images in a PDF file by Automation

    Hi,
    Can any one help me?
    How to invoke Alt-text for Images in a PDF file using script?
    Thanks for looking into this.
    Regards,
    Sudhakar

    What do you mean "invoke" alt-text?  If Alt-text is there, then it will be presented to a screen reader.

  • How to convert html file to master file in sharepoint branding

    How to convert HTML file to master file in SharePoint branding Programmatically

    Hi,
    According to your post, my understanding is that you want to convert HTML file to master file.
    You can use Design Manager to achieve it.
    On STEP 4 Edit Master Pages and clicked on the option at the top to
    Convert an HTML file to a SharePoint master page.
    Once completed, make sure the Status is set to Conversion Successful
    For more information, please refer to:
    SharePoint 2013 – Design Manager – Convert HTML to Master Page
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to convert Doc file into image

    hello frnds
                     Can any body guide me how to convert doc file into image and show into swf loader.
    actually i have to convert doc files into swf files in runtime so that i have to use this flow.
    is it possible to convert doc file into byte array and than convert into image.
    Thanks And Regards
        Vineet Osho

    You can convert any DisplayObject to byeArray using this function ImageSnapshot.captureBitmapData().getPixels()

  • Dynamic text box, HTML Text with Image

    Hello Everyone,
    I am using Flash version 8. I have used the text tool and
    created a dynamic text box and have attached the UIScrollBar
    component to it. This text box is configured to allow the use of
    html text to be inputted to it. I have code that reads a file which
    contains a list of text files that I then read and place them into
    the text box. The user can use the scroll bar to scroll through all
    the text.
    I have created an image that is a picture of the tab portion
    of a file folder. On the tab I have place some text. This was all
    done in Photoshop. This tab image is used to separate the different
    stories in the text box. The image is save as a jpeg file
    Everything you have just read works with out any problems.
    Now for the problem!
    This image is only 20 pixels tall and the text is not very
    readable. As we all know the HTML tags are very limited in Flash 8.
    Ideally I would like to put the text and image in to the text
    box as I would normally do. Then place text on top of the image and
    have it all scroll properly with in the text box.
    I have taken the tab image and converted it in to a graph
    symbol and then put the text on top of the image. This looks good;
    however I don’t know how (or if it is even possible) to place
    the graphic symbol in to the text box at the correct place within
    the text.
    Does anyone have ideas on what may work? Remember that the
    image I am working with is only 20 pixels tall which is why the
    text quality on the image is so poor.
    Thank you all for any help you may provide,
    Steve

    Yes Tim I am using the <img> tag and I know that I
    can’t place text over the image. I have set the height and
    width to be the exact size of the image. However When you go to the
    webpage it will open the movie to the maximum size based on the
    resolution of your display; however I do maintain the aspect ratio
    of the movie. For testing I did set a fix size to the size of the
    movie. Sometimes the fix size (1000x750) looks better and sometimes
    a larger size (example 1280x1024). I believe that the main problem
    is the fact the size of the image is 670 pixels wide by 25 pixels
    high and of the 25 pixels the text is only 18 pixels tall. In
    Photoshop this makes it about a 1.75 point font. As you can see the
    real problem is that I don’t have enough pixels to make up
    the text. This is why I am looking for an alterative way to create
    the text.
    I tried importing the image into flash as a graphic symbol
    and then using the text tool to create the text. The results looked
    real sharp, the text was nice and crisp (just what I wanted). The
    problem is that I could not find a way to place the graphic symbol
    into the dynamic text area like id did using the <img> tag.
    This symbol needs to scroll as you scroll the text in the text
    area.
    This is why I am asking for help. I am looking for some ideas
    that may work.
    Thank you,
    Steve

  • How to convert html to pdf using acrobat sdk 8.0?

    hi
    I am a beginner of acrobat sdk .
    I want to know How to use acrobat sdk 8.0 to convert html to pdf?
    herere some questions :
    1:How to support navigation inside PDF file that generated using acrobat sdk 8.0? For example: theres catalog in the top of HTML file, customer hopes can navigate inside the PDF file just like navigating inside the HTML file.
    2:How to support operating some controls in the PDF file that generated using acrobat sdk 8.0? For example: therere some drop down list and text box in HTML file, customer hopes can input text in the text box, click the drop down list to see available options in it just like in HTML file.
    Thanks in advance for any help and suggestion.

    Hello,
    I want a system to re-brand my 37 pages PDF for affiliates.
    I want a php dynamic link in the PDF online in order to personalize automatically the PDF for each affiliate. I need to change 2 links each time. The affiliate ID and the Paypal email (payment button) in page 36.
    Can you help?
    Please let me know
    Thank you
    Alex
    PS My system is online and i can give you the url if it helps.

  • How to display html content with image in Adobe Flash and Flex mobile project?

    Hi,
      I have a html content with image in it. How to display it in Adobe Flash Builder and Flex mobile project? Which control needs to be used for this?

    Hello,
    The only current way is to use an iFrame, or if you only need some html tags you could use the Text Layout Framework.
    Here this is the iFrame approach:
    http://code.google.com/p/flex-iframe/
    If the swc do not work in Flex4 just use its ource code which works...
    ...it is basically based on this:
    http://www.deitte.com/archives/2008/07/dont_use_iframe.htm
    see also and vote, please:
    http://bugs.adobe.com/jira/browse/SDK-12291
    http://bugs.adobe.com/jira/browse/SDK-13740
    Regards
    Marc

  • How to convert a folder of images to a Collection?

    Ques 1
    How do I convert a folder of images that has been sorted, files rejected, files hidden, and so on, to a Collection? When I create a New Collection and drag the images across from the folder, all editing is lost and the images appear in alphabetical order. I'm using CS6.
    Ques 2
    What is the location of the file that contains the sorted/rejected/hidden data for a folder?

    A Collection is just a saved search.  It does not contain any images.
    Wonder why your question went unanswered for so long?
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    A screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Convert html file into image

    hello,
    I want to create a templete for business card
    one write name , tel, fax, and upload the logo. I want to convert this tamplete
    incluisive texts and logo to an image for printing.
    how to convert this tamplete into an image
    Regards

    SVG.

  • How to convert a text file in lower case to upper case?

    I've a beginner in java world and I just come through the tutorial in http://java.sun.com/docs/books/tutorial/essential/io/filestreams.html showing how to copy a text file:
    import java.io.*;
    public class Copy {
    public static void main(String[] args) throws IOException {
         File inputFile = new File("farrago.txt");
         File outputFile = new File("outagain.txt");
    FileReader in = new FileReader(inputFile);
    FileWriter out = new FileWriter(outputFile);
    int c;
    while ((c = in.read()) != -1)
    out.write(c);
    in.close();
    out.close();
    And I would like to ask how to covert all lower case letters in input file to upper case letter in output file at the same time of copying.
    I guess it'll be using Character.toUpperCase(c), but I don't know how to do it actually.
    Any help would be much appreciated.

    Hope this helps
    import java.io.*;
    public class Copy {
    public static void main(String[] args) throws IOException {
    File inputFile = new File("farrago.txt");
    File outputFile = new File("outagain.txt");
    FileReader in = new FileReader(inputFile);
    FileWriter out = new FileWriter(outputFile);
    BufferedReader buff = new BufferedReader(in);
    String c;
    while ((c = buff.readLine()) != null)
    out.write(c.toUpperCase());
    in.close();
    out.close();
    }

  • How do I combine text and image on same screen?

    How do I comgine text and an image on the same screen in Final Cut Express 4.  I have had to use scrolling text and then import a graphic.  I want the text and graphic on the same page.  Thanks .

    Place your video clip (or still image clip) on track v1.  Then place your text clip immediately above it on track v2.  The text will overlay the image.  (Note: it doesn't necessarily have to be v1 & v2 - what's important is that the text clip be on a video track higher than the video clip/image clip.)
    Generally best to use white text, sans-serif font, larger than you might think you initially wanted.

Maybe you are looking for

  • File /folder permission problem

    Hi, I have a share on server 2012 R2 with FULL ACCESS. Now I have problem to write in it when I mounted the network share on a PC booted with WinPE. Even I mounted the share with Administrator Account. Effective permissions and ownership details seem

  • 16:9 Widescreen / possible?

    I have iMovie 5.0.2 and IDVD 5.0.1 I just finished editing a widescreen DV movie in iMovie with no problems. When I drag it to iDVD it is in the 4:3 ratio. IF YOU CAN EDIT IN WIDESCREEN USING IMOVIE 5 WHY CAN'T YOU ALSO EDIT IN WIDESCREEN IN IDVD 5?

  • Network/central storage of DW Site Data

    We're a website design firm with multiple employees.  We currently add each client's website as a DW Site including the FTP details manually on each person's computer. Is it possible for DW to store the Site data on the network instead of on the indi

  • A suggestion on hash partiton

    Hi All, We have a history table which contains nearly 4 million data. tab1(col1,col2,col3....col9) We have hash partion on col3 which has only near about 900 distinct values.Now in future these values will increase but that is not sifficient as what

  • Minecraft not detecting keyboard input after logging in

    For some reason, I cannot change my controls or move around in-game, but I can type my username and password. I'm using the Sun/Oracle Java VM (as suggested) and the AUR minecraft package. Here's the output when I launch: Username is 'sporkbox' 28 Se