mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
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:
parent
0fa9976268
commit
4a5f1d1b7a
7 changed files with 125 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue