Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create image of given URL?  RSS feed

 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I say www.rediff.com, a tools should generate .bmp/.gif/.jpg image of the homepage.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are any number of screenshot utilities that let you capture part or all of a window. Or are you thinking of an automated way of doing this?

As an aside, that's an ... interesting ... web page design.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Ulf Dittmer, I need automated way.

Actually I want to developer a tool for the person use, where I can give URL, EmailID and Duration. Tool will send email with image representation of the given URL after each *Duration* pass.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP would have no role to play in any of this. So even though more than one technology would be involved, I'm moving this to the Servlets forum.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to write some code that lays out the page in exactly the same way a browser would. So your code would need to understand and implement all of HTML, CSS, and Javascript for a start, just like a browser does. The Swing class JEditorPane allows you to use an incomplete version of that idea, namely javax.swing.text.html.HTMLEditorKit which only supports HTML 3.2 (and probably not CSS and definitely not Javascript). But given enough time you might be able to write your own EditorKit.
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you planning to do something like previewseek.com?

- manish
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Manish Hatwalne:
Are you planning to do something like previewseek.com?

- manish


NO !
For some different reason.
[ March 03, 2006: Message edited by: Chetan Parekh ]
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had used JasperReports few years back, and it did have set of API for generating reports, printing of page etc. I think it allowed facility to expot page as an image as well> Long ago I had studied GDI and other such API while doing Windows SDK Programming. These libraries do have APIs to allow you to take an image of your page/report, once you have an image/PDF (JasperReports does allow PDF exporting) scaled as per your needs, you know what has to be done!

However, arguably a better approach would be to read the contents of the URL from the remote server periodically (you'll have to take care of CSS/JS/Images etc. Not a trivial task) generate an HTML mail from it and mail it to the desired users.

HTH,
- Manish
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think JasperReports can only generate images of reports, not of arbitraray web pages.

It would be much easier to go with Manishs suggestion of downloading the HTML and associated files. A tool like Jobo can help you with that.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manish, what Ulf Dittmer is right. JasperReports cann't use for the solution I am looking for.

Ulf Dittmer, I am trying to go on the way suggested by you.
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's right, it can create images for reports but it shouldn't be difficult to write Java codeto generate such report - or so I like to believe.

Any other Java library that supports imaging/printing API?

- Manish
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Manish:

I'm curious - it's indeed not too hard to write code to generate a report in JasperReports (or even just the XML config file that defines it), but how does that help with representing some arbitrary web page? Am I missing some capabilities that JasperReports has in that regard?
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No! Maybe I am missing something.....

So main problem would be rendering an arbitrary URL that you can print/represent as an image, maybe that can be done with HTMLEditorKit, with some problems -- and now we have to get "rendered page" as it looks from this app -- so that JasperReports can print this. Or did "JFreeReport" had some of this capability...I am confused a bit....it has been ages since I made that Swing prototype for one project. Let me try to get missing pieces of this puzzle this weekend and I'll get back here.

- Manish
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chetan, this looks interesting....
http://www.timelyweb.com/free/To-Image_23138s.html

- Manish
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!