Skip to content

Commit 993f030

Browse files
authored
Add files via upload (#2154)
1 parent 6a945b8 commit 993f030

File tree

10 files changed

+343
-327
lines changed

10 files changed

+343
-327
lines changed

examples/js/acroforms.js

Lines changed: 66 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,67 @@
1-
var doc = new jsPDF();//{unit: 'px'}
2-
3-
doc.setFontSize(12);
4-
doc.text(10, 105, 'ComboBox:');
5-
6-
var d = new ComboBox();
7-
d.T = "ChoiceField1";
8-
d.TI = 1;
9-
d.Rect = [50, 100, 30, 10];
10-
d.Opt = "[(a)(b)(c)]";
11-
d.V = '(b)';
12-
d.DV = '(b)';
13-
doc.addField(d);
14-
15-
doc.text(10, 115, 'ListBox:');
16-
var d2 = new ListBox();
17-
d2.edit = false;
18-
d2.T = "ChoiceField2";
19-
d2.TI = 2;
20-
d2.Rect = [50, 110, 30, 10];
21-
d2.Opt = "[(c)(a)(d)(f)(b)(s)]";
22-
d2.V = '(s)';
23-
d2.BG = [0, 1, 1];
24-
doc.addField(d2);
25-
26-
doc.text(10, 125, 'CheckBox:');
27-
var checkBox = new CheckBox();
28-
checkBox.T = "CheckBox1";
29-
checkBox.Rect = [50, 120, 30, 10];
30-
doc.addField(checkBox);
31-
32-
doc.text(10, 135, 'PushButton:');
33-
var pushButton = new PushButton();
34-
pushButton.T = "PushButton1";
35-
pushButton.Rect = [50, 130, 30, 10];
36-
pushButton.BG = [1, 0, 0];
37-
doc.addField(pushButton);
38-
39-
doc.text(10, 145, 'TextField:');
40-
var textField = new TextField();
41-
textField.Rect = [50, 140, 30, 10];
42-
textField.multiline = true;
43-
textField.V = "The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse";//
44-
textField.T = "TestTextBox";
45-
//textField.Q = 2; // Text-Alignment
46-
doc.addField(textField);
47-
48-
doc.text(10, 155, 'Password:');
49-
var passwordField = new PasswordField();
50-
passwordField.Rect = [50, 150, 30, 10];
51-
doc.addField(passwordField);
52-
53-
doc.text(50, 165, 'RadioGroup:');
54-
var radioGroup = new RadioButton();
55-
radioGroup.V = "/Test";
56-
radioGroup.Subtype = "Form";
57-
58-
doc.addField(radioGroup);
59-
60-
var radioButton1 = radioGroup.createOption("Test");
61-
radioButton1.Rect = [50, 170, 30, 10];
62-
radioButton1.AS = "/Test";
63-
64-
var radioButton2 = radioGroup.createOption("Test2");
65-
radioButton2.Rect = [50, 180, 30, 10];
66-
67-
var radioButton3 = radioGroup.createOption("Test3");
68-
radioButton3.Rect = [50, 190, 20, 10];
69-
1+
var doc = new jsPDF();//{unit: 'px'}
2+
3+
doc.setFontSize(12);
4+
doc.text('ComboBox:', 10, 105);
5+
6+
var comboBox = new ComboBox();
7+
comboBox.fieldName = "ChoiceField1";
8+
comboBox.topIndex = 1;
9+
comboBox.Rect = [50, 100, 30, 10];
10+
comboBox.setOptions(['a', 'b', 'c']);
11+
comboBox.value = 'b';
12+
comboBox.defaultValue = 'b';
13+
doc.addField(comboBox);
14+
15+
doc.text('ListBox:', 10, 115);
16+
var listbox = new ListBox();
17+
listbox.edit = false;
18+
listbox.fieldName = "ChoiceField2";
19+
listbox.topIndex = 2;
20+
listbox.Rect = [50, 110, 30, 10];
21+
listbox.setOptions(["c", "a", "d", "f", "b", "s"]);
22+
listbox.value = 's';
23+
doc.addField(listbox);
24+
25+
doc.text('CheckBox:', 10, 125,);
26+
var checkBox = new CheckBox();
27+
checkBox.fieldName = "CheckBox1";
28+
checkBox.Rect = [50, 120, 30, 10];
29+
doc.addField(checkBox);
30+
31+
doc.text( 'PushButton:', 10, 135);
32+
var pushButton = new PushButton();
33+
pushButton.fieldName = "PushButton1";
34+
pushButton.Rect = [50, 130, 30, 10];
35+
doc.addField(pushButton);
36+
37+
doc.text('TextField:', 10, 145);
38+
var textField = new TextField();
39+
textField.Rect = [50, 140, 30, 10];
40+
textField.multiline = true;
41+
textField.value = "The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse";//
42+
textField.fieldName = "TestTextBox";
43+
doc.addField(textField);
44+
45+
doc.text('Password:', 10, 155);
46+
var passwordField = new PasswordField();
47+
passwordField.Rect = [50, 150, 30, 10];
48+
doc.addField(passwordField);
49+
50+
doc.text('RadioGroup:', 50, 165);
51+
var radioGroup = new RadioButton();
52+
radioGroup.value = "Test";
53+
radioGroup.Subtype = "Form";
54+
55+
doc.addField(radioGroup);
56+
57+
var radioButton1 = radioGroup.createOption("Test");
58+
radioButton1.Rect = [50, 170, 30, 10];
59+
radioButton1.AS = "/Test";
60+
61+
var radioButton2 = radioGroup.createOption("Test2");
62+
radioButton2.Rect = [50, 180, 30, 10];
63+
64+
var radioButton3 = radioGroup.createOption("Test3");
65+
radioButton3.Rect = [50, 190, 20, 10];
66+
7067
radioGroup.setAppearance(AcroForm.Appearance.RadioButton.Cross);

examples/js/autoprint.js

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/js/editor.js

Lines changed: 177 additions & 178 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/js/font-faces.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
var doc = new jsPDF();
2-
3-
doc.text(20, 20, 'This is the default font.');
4-
5-
doc.setFont("courier");
6-
doc.setFontType("normal");
7-
doc.text(20, 30, 'This is courier normal.');
8-
9-
doc.setFont("times");
10-
doc.setFontType("italic");
11-
doc.text(20, 40, 'This is times italic.');
12-
13-
doc.setFont("helvetica");
14-
doc.setFontType("bold");
15-
doc.text(20, 50, 'This is helvetica bold.');
16-
17-
doc.setFont("courier");
18-
doc.setFontType("bolditalic");
19-
doc.text(20, 60, 'This is courier bolditalic.');
20-
21-
doc.setFont("times");
22-
doc.setFontType("normal");
23-
doc.text(105, 80, 'This is centred text.', null, null, 'center');
24-
doc.text(105, 90, 'And a little bit more underneath it.', null, null, 'center');
25-
doc.text(200, 100, 'This is right aligned text', null, null, 'right');
26-
doc.text(200, 110, 'And some more', null, null, 'right');
27-
doc.text(20, 120, 'Back to left');
28-
29-
doc.text(20, 140, '10 degrees rotated', null, 10);
30-
doc.text(20, 160, '-10 degrees rotated', null, -10);
1+
var doc = new jsPDF();
2+
3+
doc.text('This is the default font.', 20, 20);
4+
5+
doc.setFont("courier");
6+
doc.setFontStyle("normal");
7+
doc.text('This is courier normal.', 20, 30);
8+
9+
doc.setFont("times");
10+
doc.setFontStyle("italic");
11+
doc.text('This is times italic.', 20, 40);
12+
13+
doc.setFont("helvetica");
14+
doc.setFontStyle("bold");
15+
doc.text('This is helvetica bold.', 20, 50);
16+
17+
doc.setFont("courier");
18+
doc.setFontStyle("bolditalic");
19+
doc.text('This is courier bolditalic.', 20, 60);
20+
21+
doc.setFont("times");
22+
doc.setFontStyle("normal");
23+
doc.text('This is centred text.', 105, 80, null, null, 'center');
24+
doc.text('And a little bit more underneath it.', 105, 90, null, null, 'center');
25+
doc.text('This is right aligned text', 200, 100, null, null, 'right');
26+
doc.text('And some more', 200, 110, null, null, 'right');
27+
doc.text('Back to left',20, 120);
28+
29+
doc.text('10 degrees rotated', 20, 140, null, 10);
30+
doc.text('-10 degrees rotated', 20, 160, null, -10);

examples/js/font-size.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
var doc = new jsPDF();
2-
doc.setFontSize(22);
3-
doc.text(20, 20, 'This is a title');
4-
5-
doc.setFontSize(16);
6-
doc.text(20, 30, 'This is some normal sized text underneath.');
1+
var doc = new jsPDF();
2+
doc.setFontSize(22);
3+
doc.text('This is a title', 20, 20);
4+
5+
doc.setFontSize(16);
6+
doc.text('This is some normal sized text underneath.', 20, 30);

examples/js/images.js

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/js/japanese.js

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/js/landscape.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
var doc = new jsPDF('landscape');
2-
doc.text(20, 20, 'Hello landscape world!');
1+
var doc = new jsPDF('landscape');
2+
doc.text('Hello landscape world!', 20, 20);

examples/js/text-colors.js

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
var doc = new jsPDF();
2-
3-
// I know the proper spelling is colour ;)
4-
doc.setTextColor(100);
5-
doc.text(20, 20, 'This is gray.');
6-
7-
doc.setTextColor(150);
8-
doc.text(20, 30, 'This is light gray.');
9-
10-
doc.setTextColor(255, 0, 0);
11-
doc.text(20, 40, 'This is red.');
12-
13-
doc.setTextColor(0, 255, 0);
14-
doc.text(20, 50, 'This is green.');
15-
16-
doc.setTextColor(0, 0, 255);
17-
doc.text(20, 60, 'This is blue.');
1+
var doc = new jsPDF();
2+
3+
// I know the proper spelling is colour ;)
4+
doc.setTextColor(100);
5+
doc.text('This is gray.', 20, 20);
6+
7+
doc.setTextColor(150);
8+
doc.text('This is light gray.', 20, 30);
9+
10+
doc.setTextColor(255, 0, 0);
11+
doc.text('This is red.', 20, 40);
12+
13+
doc.setTextColor(0, 255, 0);
14+
doc.text('This is green.', 20, 50);
15+
16+
doc.setTextColor(0, 0, 255);
17+
doc.text('This is blue.', 20, 60);
18+
19+
doc.setTextColor('red');
20+
doc.text('This is red.', 60, 40);
21+
22+
doc.setTextColor('green');
23+
doc.text('This is green.', 60, 50);
24+
25+
doc.setTextColor('blue');
26+
doc.text('This is blue.', 60, 60);

examples/js/two-page.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var doc = new jsPDF();
2-
doc.text(20, 20, 'Hello world!');
3-
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
4-
doc.addPage('a6','l');
5-
doc.text(20, 20, 'Do you like that?');
1+
var doc = new jsPDF();
2+
doc.text('Hello world!', 20, 20);
3+
doc.text('This is client-side Javascript, pumping out a PDF.', 20, 30);
4+
doc.addPage('l', 'a6');
5+
doc.text('Do you like that?', 20, 20);

0 commit comments

Comments
 (0)