Re: convert webpage to image

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



>From: Carl T. Miller <carl@xxxxxxxxxx>

>To: CentOS <centos@xxxxxxxxxx> 
>Sent: Wednesday, August 14, 2013 5:47 AM
>Subject:  convert webpage to image
 
>
>What is the easiest way to convert a webpage into a jpg
>or png file?  I've seen several programs that can do
>various conversions, but nothing open source that can
>do it in a single conversion.

I wrote a few lines to do this, but it involves using firefox, and 'import' from ImageMagick.

The first script starts firefox in a virtual frame:

===
Xvfb :2 -screen 0 1280x1024x24 > /dev/null 2>&1 &
export DISPLAY=localhost:2.0

firefox http://ip.of.your.page/page.html &
===

Then the second script captures/crops what I want:

===
export DISPLAY=localhost:2.0
import -crop '1024x512+54+235' -window root /path/to/result.png
==

You'll have to adjust the crop values to what you want.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux