topical media & game development

talk show tell print

mobile-graphic-enchant-tests-raster-rasterize.js / js



  var page = new WebPage(),
    address, output, size;
   
  if (phantom.args.length < 2 || phantom.args.length > 3) {
    console.log('Usage: rasterize.js URL filename');
    phantom.exit();
  } else {
    address = phantom.args[0];
    output = phantom.args[1];
    page.viewportSize = { width: 1024, height: 768 };
    page.open(address, function (status) {
      if (status !== 'success') {
        console.log('Unable to load the address!');
      } else {
        window.setTimeout(function () {
          page.render(output);
          phantom.exit();
        }, 1000);
      }
    });
  }


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.