> Haofei wrote: > > for example i want to have a method which just like > > > > def preview_of ( url ) > > #some relate operation > > end > > > > then i can have a picture (jpeg, png ...) of the web page somewhere, > > i am not familiar with the graphic libraries of ruby. > > do u guys have write something like this ? > > thanks :-) > > > > def preview_of(url) > `opera -newpage #{url}` > end > > *cough* > > Seriously, this is a nontrivial example that requires you to more or > less write a webbrowser. The simplest (relatively speaking) way would be > to use ruby-gnome2 and Gtk::MozEmbed, and severe whacking of Gtk with a > cluebyfour to make it render to an image buffer which you'd then output > to disk. David is correct. It's a problem I've spent numerous hours on. All the existing libraries seem to be lacking. The "easiest" approach is to use an existing web browser rendering engine. Michael