Mercurial > hg > nodescore
diff rasterize.js @ 26:ac9641ecf84f
updated rasterize and ss2thumb to cycle offsets of grab for different anchors
removed some bad path stuctures
author | tzara <rc-web@kiben.net> |
---|---|
date | Mon, 16 Jul 2012 16:51:55 +0100 |
parents | d2eda8be1fca |
children | ea19684cd1db |
line wrap: on
line diff
--- a/rasterize.js Sun Jul 15 01:14:27 2012 +0100 +++ b/rasterize.js Mon Jul 16 16:51:55 2012 +0100 @@ -2,7 +2,9 @@ system = require('system'), address, output, size; -page.clipRect = { top: 70, left: 0, width: 1280, height: 800 } +top = system.args[3]; + +page.clipRect = { top: top, left: 0, width: 1280, height: 800 } if (system.args.length < 3 || system.args.length > 5) { console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); @@ -11,14 +13,16 @@ } else { address = system.args[1]; output = system.args[2]; + + page.viewportSize = { width: 800, height: 800 }; - if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") { - size = system.args[3].split('*'); + if (system.args.length > 4 && system.args[2].substr(-4) === ".pdf") { + size = system.args[4].split('*'); page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' } : { format: system.args[3], orientation: 'portrait', margin: '1cm' }; } - if (system.args.length > 4) { - page.zoomFactor = system.args[4]; + if (system.args.length > 5) { + page.zoomFactor = system.args[5]; } page.open(address, function (status) { if (status !== 'success') {