Fra l'altro, è possibile ottenere anche un file PDF.
Dopo aver installato PhantomJS, è sufficiente creare un file di testo con un contenuto simile al seguente:
// webpage_screenshot.js
var page = require('webpage').create();
var system = require("system");
page.open(system.args[1], function () {
page.render(system.args[2]);
phantom.exit();
});
e lanciare il comando
phantomjs webpage_screenshot.js http://www.example.com example.pngoppure
phantomjs webpage_screenshot.js http://www.example.com example.pdfPhantomJS può essere usato anche per produrre documenti complessi basandosi su contenuti HTML5, come nell'esempio della fattura presentato su we-love-php.blogspot.nl.