Last change
on this file since 31525 was 31525, checked in by ak19, 7 years ago |
Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.
|
File size:
1.0 KB
|
Line | |
---|
1 | var page = require('webpage').create(),
|
---|
2 | system = require('system');
|
---|
3 |
|
---|
4 | if (system.args.length < 7) {
|
---|
5 | console.log('Usage: printmargins.js URL filename LEFT TOP RIGHT BOTTOM');
|
---|
6 | console.log(' margin examples: "1cm", "10px", "7mm", "5in"');
|
---|
7 | phantom.exit(1);
|
---|
8 | } else {
|
---|
9 | var address = system.args[1];
|
---|
10 | var output = system.args[2];
|
---|
11 | var marginLeft = system.args[3];
|
---|
12 | var marginTop = system.args[4];
|
---|
13 | var marginRight = system.args[5];
|
---|
14 | var marginBottom = system.args[6];
|
---|
15 | page.viewportSize = { width: 600, height: 600 };
|
---|
16 | page.paperSize = {
|
---|
17 | format: 'A4',
|
---|
18 | margin: {
|
---|
19 | left: marginLeft,
|
---|
20 | top: marginTop,
|
---|
21 | right: marginRight,
|
---|
22 | bottom: marginBottom
|
---|
23 | }
|
---|
24 | };
|
---|
25 | page.open(address, function (status) {
|
---|
26 | if (status !== 'success') {
|
---|
27 | console.log('Unable to load the address!');
|
---|
28 | } else {
|
---|
29 | window.setTimeout(function () {
|
---|
30 | page.render(output);
|
---|
31 | phantom.exit();
|
---|
32 | }, 200);
|
---|
33 | }
|
---|
34 | });
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.