Working with moz-headless-screenshot

For an upcoming project, we needed a program that would make a screenshot of a rendered webpage. It needed to work on a linux box not running a gui. That limited the options quite a bit. The solution was a nifty program called moz-headless-screenshot. Getting it to compile, however, turned out to be a bit of a challenge.

Following the directions in the Makefile located at worked very well up until step 6, make. Running make gave some nasty errors about libssl. Replacing this line in the Makefile

LIBS = `pkg-config –libs glib-2.0 gobject-2.0 cairo` -lm -ldl -L$(OBJDIR)/dist/lib -lnspr4 -lplds4 -lplc4 -lxul -lsqlite3 -lmozjs -lsoftokn3 -lnssutil3 -lnss3 $(OBJDIR)/embedding/browser/headless/src/libmozheadless.a

with this line

LIBS = `pkg-config –libs glib-2.0 gobject-2.0 cairo` -lm -ldl -L$(OBJDIR)/dist/lib -lnspr4 -lplc4 -lxul -lsqlite3 -lmozjs -lsoftokn3 $(OBJDIR)/embedding/browser/headless/src/libmozheadless.a

fixed those problems.

If you have errors before you even get to step number 6, double check and make sure you have the development libraries for building Mozilla installed.


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>