Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to capture a website as an image? 1

Status
Not open for further replies.

nikola11

Programmer
Oct 4, 2007
5
CA
Hi all,

I'm trying to capture the look of a given website as an image using java. I'm not looking for a screen print of my current screen. I'd like to pass in the website address, get the html, and then convert that html into an image. Basically I need a HTML to image converter.

I've seen it done with .net and vb but I'm running tomcat on a linux server so I need to do it in java.

Any and all help is appreciated, I've been searching for a solution for a while without any success.

Thanks,

Nik
 
Yup, the robot can take a screenshot, but like I said in the first post the screenshot doesn't help me much. I'm running this on a server so I can't be opening up a browser than loading in a page and than taking a screenshot. Its too labor intensive if I have to do many pages.

The robot seems to be answer I keep getting which leads me to believe that there may not be a java solution for transforming html into an image.

any other suggestions?
 
There is probably a better way, but using htmldoc to convert a page to pdf, then java to convert the pdf to an image would get the job done. Although htmldoc is not java, you should be able to call it from java. I use htmldoc by calling a java stored procedure in an oracle database, without any issues. If you decide to go this way, I'd recommed version 1.8.27 over 1.9. I had a lot less problems that way.
 
Thats a great idea. I'll give it a shot and see what I can come up with.

Thanks.
 
If the html is not too elaborated, you can put it in a label.
Afaik this doesn't work for css, javascript and so on.

Without a screen, you may run java with the headless-option.
I don't know whether it is possible to do virtual screen captures.


don't visit my homepage:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top