Forum: Ruby convert html to image

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
cjokomay (Guest)
on 2008-10-22 04:42
(Received via mailing list)
I would like to take an html file, or even just an html string, and
convert it to an image (e.g. jpg or png). Unfortunately I have no idea
where to even begin. I imagine that it would involve the use of
rmagick, in fact I believe its possible to convert html to pdf and
then pdf to image, so I will start researching that angle.

Any help would be greatly appreciated, even a just a push in the right
direction would be great!

Thank you.
Josef 'Jupp' Schugt (Guest)
on 2008-10-23 17:05
(Received via mailing list)
On Wed, 22 Oct 2008 02:39:20 +0200, cjokomay 
<removed_email_address@domain.invalid> wrote:

> I would like to take an html file, or even just an html string, and
> convert it to an image (e.g. jpg or png).

Shall the image show (possibly syntax highlighted) HTML source or
rendered
HTML and if the latter rendered using which engine? Please indicate the
operating systems(s) the software is to work on because the solution is
likely to depend on it.

Josef 'Jupp' Schugt
unknown (Guest)
on 2008-10-24 15:15
(Received via mailing list)
On 23 oct, 15:02, Josef 'Jupp' Schugt <removed_email_address@domain.invalid> 
wrote:
> --
> Blog:http://penpen.goodaddress.eu/
> PGP key (id 6CC6574F):http://wwwkeys.de.pgp.net/
> Jabber -http://www.jabber.org/- contact information on request

Hi,

I would like to do smae thing. So, if I understand your answer, we
should first choose one html renderer: gecko, webkit, etc...

Is it correct ? Thanks !!

Regards,
José Luis
Robert H. (Guest)
on 2008-10-24 17:13
I would like to ask this too - is there a somewhat easy way to
"simulate" a user viewing a remote html page and have ruby capture the
resulting image, as if he were to look at it via browser, but _without_
any user interaction? (i.e. a "silent" ruby script to produce such
images)
Ara H. (Guest)
on 2008-10-24 21:05
(Received via mailing list)
On Oct 21, 2008, at 6:39 PM, cjokomay wrote:

>  would like to take an html file, or even just an html string, and
> convert it to an image (e.g. jpg or png). Unfortunately I have no idea
> where to even begin. I imagine that it would involve the use of
> rmagick, in fact I believe its possible to convert html to pdf and
> then pdf to image, so I will start researching that angle.
>
> Any help would be greatly appreciated, even a just a push in the right
> direction would be great!
>
> Thank you.

look at the image magick label functions, it's possible that alone
will give you want you want: which is, i assume, to dump a text string
into an image.

a @ http://codeforpeople.com/
Mark T. (Guest)
on 2008-10-27 15:21
(Received via mailing list)
If you're talking about web page thumbnails (not sure about the OP but
some of the follow-ups are), then you may be able to use this:

http://cutycapt.sourceforge.net/

-- Mark.
This topic is locked and can not be replied to.