projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
documentation
[mkws-moved-to-github.git]
/
test
/
spec-dev
/
screenshot.js
diff --git
a/test/spec-dev/screenshot.js
b/test/spec-dev/screenshot.js
index
038f12d
..
e5d3f83
100644
(file)
--- a/
test/spec-dev/screenshot.js
+++ b/
test/spec-dev/screenshot.js
@@
-1,20
+1,26
@@
-// run: phantomjs /path/to/this/file
-var url = 'http://www.indexdata.com/';
-var file_png = "indexdata.png";
+var page = require('webpage').create(),
+ system = require('system');
-var page = require('webpage').create();
+var url = system.args[1] || 'http://www.indexdata.com/';
+var file_png = system.args[2] || 'indexdata.png';
+
+if (system.args.length === 1) {
+ console.log('Usage: screenshot.js <some URL> <file.png>');
+ phantom.exit();
+}
// page.paperSize = { format: 'A4', orientation: "landscape" };
// page.paperSize = { format: 'A4', orientation: "landscape" };
+// page.zoomFactor = 1.0;
page.viewportSize = {
page.viewportSize = {
- width: 960,
- height: 800
+ width: 1200,
+ height: 1000
};
};
-page.zoomFactor = 1.0;
page.open(url, function () {
// small delay
setTimeout(function () {
page.render(file_png);
page.open(url, function () {
// small delay
setTimeout(function () {
page.render(file_png);
+ console.log(page);
phantom.exit();
}, 500);
});
phantom.exit();
}, 500);
});