JS - Fix setting a color on an annotation

- strokeColor corresponds to borderColor;
 - support fillColor and textColor;
 - support colors on the different annotations;
 - fix typo in aforms (+test).
This commit is contained in:
Calixte Denizet 2021-02-20 15:23:54 +01:00
parent 0fa9976268
commit 4a5f1d1b7a
7 changed files with 125 additions and 8 deletions

View file

@ -140,6 +140,14 @@ class Field extends PDFObject {
}
}
get bgColor() {
return this.fillColor;
}
set bgColor(color) {
this.fillColor = color;
}
get numItems() {
if (!this._isChoice) {
throw new Error("Not a choice widget");
@ -161,6 +169,14 @@ class Field extends PDFObject {
}
}
get borderColor() {
return this.strokeColor;
}
set borderColor(color) {
this.strokeColor = color;
}
get textColor() {
return this._textColor;
}
@ -171,6 +187,14 @@ class Field extends PDFObject {
}
}
get fgColor() {
return this.textColor;
}
set fgColor(color) {
this.textColor = color;
}
get value() {
return this._value;
}