1 page = require("webpage").create()
2 system = require("system")
3 if system.args.length < 7
4 console.log "Usage: printmargins.js URL filename LEFT TOP RIGHT BOTTOM"
5 console.log " margin examples: \"1cm\", \"10px\", \"7mm\", \"5in\""
8 address = system.args[1]
9 output = system.args[2]
10 marginLeft = system.args[3]
11 marginTop = system.args[4]
12 marginRight = system.args[5]
13 marginBottom = system.args[6]
26 page.open address, (status) ->
27 if status isnt "success"
28 console.log "Unable to load the address!"