[webkit-gtk] Taking full webpage screenshots

James Wu jwu at eyereturn.com
Thu Aug 11 06:45:23 PDT 2011

> > This is the code I have so far and with this I am only able to get the
> > visible parts of the browser in the screenshot. What is the best way to
> get
> > a snapshot of the entire webpage ?
> If you figure out a way to take a screenshot without the need of a
> DISPLAY (X Server) please let me know. You should be able to modify
> the C program to support other output formats by simply changing the
> cairo surface.

The answer to both is to use Xvfb. I created an Xvfb instance with extremely
large dimensions so that any webpage that might load would have room to
stretch to the proper size. Running Xvfb also alleviates the need for an X

The trick is to use Xvfb to create a display, then use gdk's display manager
to set the default display,
ie: "Xvfb :99 -screen 0 2000x30000x24"

You can also use Xvfb-run if you're only taking a single screenshot and
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20110811/591cad92/attachment.html>

More information about the webkit-gtk mailing list