Skip to content

Commit 5505b6d

Browse files
authored
Accessibility Issue: CS / cs Operator Error in Tagged Table (#1666)
* Accessibility Issue: CS / cs Operator Error in Tagged Table #1640 * Fix Table Accessibility Issue: Operator CS/cs not allowed in this current state * revert modifications at debug line
1 parent 0b01ef4 commit 5505b6d

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- Fix garbled text copying in Chrome/Edge for PDFs with >256 unique characters (#1659)
66
- Fix Link accessibility issues
7+
- Fix Table Accessibility Issue: Operator CS/cs not allowed in this current state
8+
79

810
### [v0.17.2] - 2025-08-30
911

lib/table/render.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ function renderCell(cell, rowStruct) {
3434
if (cell.backgroundColor != null) {
3535
this.document
3636
.save()
37+
.fillColor(cell.backgroundColor)
3738
.rect(cell.x, cell.y, cell.width, cell.height)
38-
.fill(cell.backgroundColor)
39+
.fill()
3940
.restore();
4041
}
4142

@@ -173,8 +174,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) {
173174
doc
174175
.save()
175176
.lineWidth(border.top)
177+
.strokeColor(borderColor.top)
176178
.rect(x, y, width, height)
177-
.stroke(borderColor.top)
179+
.stroke()
178180
.restore();
179181
}
180182
} else {
@@ -184,8 +186,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) {
184186
.save()
185187
.lineWidth(border.top)
186188
.moveTo(x, y)
189+
.strokeColor(borderColor.top)
187190
.lineTo(x + width, y)
188-
.stroke(borderColor.top)
191+
.stroke()
189192
.restore();
190193
}
191194
// Right
@@ -194,8 +197,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) {
194197
.save()
195198
.lineWidth(border.right)
196199
.moveTo(x + width, y)
200+
.strokeColor(borderColor.right)
197201
.lineTo(x + width, y + height)
198-
.stroke(borderColor.right)
202+
.stroke()
199203
.restore();
200204
}
201205
// Bottom
@@ -204,8 +208,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) {
204208
.save()
205209
.lineWidth(border.bottom)
206210
.moveTo(x + width, y + height)
211+
.strokeColor(borderColor.bottom)
207212
.lineTo(x, y + height)
208-
.stroke(borderColor.bottom)
213+
.stroke()
209214
.restore();
210215
}
211216
// Left
@@ -214,8 +219,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) {
214219
.save()
215220
.lineWidth(border.left)
216221
.moveTo(x, y + height)
222+
.strokeColor(borderColor.left)
217223
.lineTo(x, y)
218-
.stroke(borderColor.left)
224+
.stroke()
219225
.restore();
220226
}
221227
}

0 commit comments

Comments
 (0)