Merge pull request #20948 from calixteman/issue20914

Interpret empty annotation border as [0, 0, 0]
This commit is contained in:
Tim van der Meij 2026-03-22 19:08:19 +01:00 committed by GitHub
commit 0a6894d28b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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"
}
]