Introduction
Up to this point, our discussion on PhantomJS focused on its headless nature; while there are many advantages to it, there is also one obvious disadvantage—you can't see anything when you need to.
Fortunately, the PhantomJS webpage
API exposes a couple of methods for rendering web page content as images and documents. We have seen a couple of these methods already; in this chapter, we will explore them in more detail, and discuss how to apply them. We will see strategies for exporting different types of images, PDFs, rasterizing SVGs, and everything else we need to know to get visual information back out of PhantomJS.