Results 1 to 2 of 2
  1. #1
    Rajkumar is offline Member
    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Post Convert HTML file into JPEG

    Hi,

    I want to convert a HTML file into PNG image. My HTML page has IMAGES as well.
    For this I'm using html2image java library.
    When I'm converting my HTML file, the images are broken.


    Code:
    =====
    HtmlImageGenerator imageGenerator = new HtmlImageGenerator();
    imageGenerator.loadHtml("<p>test test <b>test</b> xxx <a title='test\" link' href='http://www.google.com'>link<br/>link</a>xxx xxx</p><img width=\"820\" height=\"347\" alt=\"ביטוח ישיר\" style=\"width: 820px; height: 347px;\" src=\"http://www.555.co.il/resources/images/mail/astro_email_template/555_1.jpg\"><br/><img width=\"820\" height=\"132\" alt=\"ביטוח ישיר\" style=\"width: 820px; height: 132px;\" src=\"http://www.555.co.il/resources/images/mail/astro_email_template/555_2.jpg\">");
    imageGenerator.saveAsImage("d:/temp/test2.png");
    imageGenerator.saveAsHtmlWithMap("/temp/test2.html", "test2.png");

    Output of converted Image:
    ======================
    Convert HTML file into JPEG-test2.png


    Please help me to convert html pages (along with images) into PNG file.

    Thanks,
    Rajkumar.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Convert HTML file into JPEG

    Please go through Guide For New Members and BB Code List - Java Programming Forum - Learn Java Programming and edit your post accordingly.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 0
    Last Post: 07-11-2012, 01:18 PM
  2. Replies: 0
    Last Post: 02-24-2012, 05:18 PM
  3. Convert jpeg image to int
    By aelynne in forum New To Java
    Replies: 3
    Last Post: 10-26-2011, 08:25 PM
  4. How to convert html file to text
    By chamnan in forum Advanced Java
    Replies: 5
    Last Post: 09-08-2010, 02:02 PM
  5. To open an image file such as Jpeg file using JAva Program
    By itmani2020 in forum Advanced Java
    Replies: 10
    Last Post: 07-11-2008, 10:57 AM

Tags for this Thread

Posting Permissions

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