Interpret empty annotation border as [0, 0, 0]

It fixes #20914.
This commit is contained in:
calixteman 2026-03-22 14:41:47 +01:00
parent 869f25a489
commit de48af76d4
No known key found for this signature in database
GPG Key ID: 0C5442631EE0691F
3 changed files with 20 additions and 7 deletions

View File

@ -1104,14 +1104,18 @@ class Annotation {
}
} else if (borderStyle.has("Border")) {
const array = borderStyle.getArray("Border");
if (Array.isArray(array) && array.length >= 3) {
this.borderStyle.setHorizontalCornerRadius(array[0]);
this.borderStyle.setVerticalCornerRadius(array[1]);
this.borderStyle.setWidth(array[2], this.rectangle);
if (Array.isArray(array)) {
if (array.length >= 3) {
this.borderStyle.setHorizontalCornerRadius(array[0]);
this.borderStyle.setVerticalCornerRadius(array[1]);
this.borderStyle.setWidth(array[2], this.rectangle);
if (array.length === 4) {
// Dash array available
this.borderStyle.setDashArray(array[3], /* forceStyle = */ true);
if (array.length === 4) {
// Dash array available
this.borderStyle.setDashArray(array[3], /* forceStyle = */ true);
}
} else if (array.length === 0) {
this.borderStyle.setWidth(0);
}
}
} else {

View File

@ -0,0 +1 @@
https://github.com/user-attachments/files/26097319/SiemensTest.PDF

View File

@ -14020,5 +14020,13 @@
"rounds": 1,
"link": true,
"type": "eq"
},
{
"id": "issue20914",
"file": "pdfs/issue20914.pdf",
"md5": "5740b4600e40c6fc920d38f96a74c6a5",
"rounds": 1,
"link": true,
"type": "eq"
}
]