Skip to content

Commit 5017743

Browse files
committed
don't default black border, only default white background for radioButtons
1 parent d3c9ff4 commit 5017743

15 files changed

+21
-19
lines changed

examples/js/acroforms.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function addComboBox() {
3232
comboBox.setOptions(["a", "b", "c"]);
3333
comboBox.value = "b";
3434
comboBox.defaultValue = "b";
35+
comboBox.borderColor = [0]; // black
3536
doc.addField(comboBox);
3637
yPos += margin;
3738
}
@@ -45,6 +46,7 @@ function addListBox() {
4546
listbox.Rect = [50, yPos - 5, 30, 10];
4647
listbox.setOptions(["c", "a", "d", "f", "b", "s"]);
4748
listbox.value = "s";
49+
listbox.borderColor = [0];
4850
doc.addField(listbox);
4951
yPos += margin;
5052
}
@@ -54,6 +56,7 @@ function addCheckBox() {
5456
var checkBox = new CheckBox();
5557
checkBox.fieldName = "CheckBox1";
5658
checkBox.Rect = [50, yPos - 5, 30, 10];
59+
checkBox.borderColor = [0];
5760
doc.addField(checkBox);
5861
yPos += margin;
5962
}
@@ -64,6 +67,7 @@ function addPushButton() {
6467
pushButton.fieldName = "PushButton1";
6568
pushButton.Rect = [50, yPos - 5, 30, 10];
6669
pushButton.caption = "OK";
70+
pushButton.borderColor = [0];
6771
doc.addField(pushButton);
6872
yPos += margin;
6973
}
@@ -76,6 +80,7 @@ function addTextField() {
7680
textField.value =
7781
"The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse";
7882
textField.fieldName = "TestTextBox";
83+
textField.borderColor = [0];
7984
doc.addField(textField);
8085
yPos += margin;
8186
}
@@ -84,6 +89,7 @@ function addPasswordField() {
8489
doc.text("Password:", 10, yPos);
8590
var passwordField = new PasswordField();
8691
passwordField.Rect = [50, yPos - 5, 40, 10];
92+
passwordField.borderColor = [0];
8793
doc.addField(passwordField);
8894
yPos += margin;
8995
}
@@ -95,6 +101,7 @@ function addRadioGroups() {
95101
// First radio group
96102
var radioGroup = new RadioButton();
97103
radioGroup.fieldName = "RadioGroup1";
104+
radioGroup.borderColor = [0];
98105
doc.addField(radioGroup);
99106
yPos -= 5;
100107

src/modules/acroform.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,9 +1693,10 @@ var AcroFormField = function() {
16931693
enumerable: true,
16941694
configurable: false,
16951695
get: function() {
1696-
_MK.BG = _MK.BG || [1, 1, 1]; // default to white background
1697-
_MK.BC = _MK.BC || [0, 0, 0]; // default to black border
1698-
1696+
if (!Object.keys(_MK).length) {
1697+
return undefined;
1698+
}
1699+
16991700
var result = [];
17001701
result.push("<<");
17011702
for (let key in _MK) {
@@ -1728,7 +1729,7 @@ var AcroFormField = function() {
17281729
* 4 DeviceCMYK
17291730
* @name borderColor
17301731
* @memberof AcroFormField#
1731-
* @default [0, 0, 0] black
1732+
* @default (no color, transparent)
17321733
* @type {array}
17331734
*/
17341735
Object.defineProperty(this, "borderColor", {
@@ -1749,7 +1750,7 @@ var AcroFormField = function() {
17491750
* (Optional) An array of numbers in the range 0.0 to 1.0 specifying the color of the widget annotation’s background. The number of array elements determines the color space, as described above for borderColor.
17501751
* @name backgroundColor
17511752
* @memberof AcroFormField#
1752-
* @default [1, 1, 1] white
1753+
* @default (no color, transparent)
17531754
* @type {array}
17541755
*/
17551756
Object.defineProperty(this, "backgroundColor", {
@@ -2328,6 +2329,7 @@ var AcroFormRadioButton = function() {
23282329
AcroFormButton.call(this);
23292330
this.radio = true;
23302331
this.pushButton = false;
2332+
this.backgroundColor = [1]; // white
23312333

23322334
var _Kids = [];
23332335
Object.defineProperty(this, "Kids", {
@@ -3593,7 +3595,6 @@ var AcroFormAppearance = {
35933595
getCA: function() {
35943596
return "8";
35953597
},
3596-
35973598
YesNormal: function(formObject) {
35983599
var xobj = createFormXObject(formObject);
35993600
xobj.scope = formObject.scope;

test/reference/checkbox.pdf

-24 Bytes
Binary file not shown.

test/reference/combobox.pdf

-34 Bytes
Binary file not shown.
-280 Bytes
Binary file not shown.

test/reference/listbox.pdf

-34 Bytes
Binary file not shown.

test/reference/password.pdf

-34 Bytes
Binary file not shown.

test/reference/pushbutton.pdf

-24 Bytes
Binary file not shown.

test/reference/radiogroup.pdf

-64 Bytes
Binary file not shown.

test/reference/radiogroup2.pdf

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)