From 10ced4902583d10c2196f99c1b57456bd7e2f405 Mon Sep 17 00:00:00 2001 From: ajaykrdas Date: Mon, 15 Dec 2025 13:53:57 +0000 Subject: [PATCH 1/3] Accessibility Issue: CS / cs Operator Error in Tagged Table #1640 --- lib/table/render.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/table/render.js b/lib/table/render.js index e9a80d8c..e50ec9ec 100644 --- a/lib/table/render.js +++ b/lib/table/render.js @@ -34,8 +34,9 @@ function renderCell(cell, rowStruct) { if (cell.backgroundColor != null) { this.document .save() + .fillColor(cell.backgroundColor) .rect(cell.x, cell.y, cell.width, cell.height) - .fill(cell.backgroundColor) + .fill() .restore(); } @@ -57,8 +58,9 @@ function renderCell(cell, rowStruct) { // Debug cell bounds this.document + .strokeColor('green') .rect(cell.x, cell.y, cell.width, cell.height) - .stroke('green'); + .stroke(); this.document.restore(); } @@ -114,19 +116,21 @@ function renderCellText(cell) { // Debug actual text bounds if (cell.text) { doc + .strokeColor('blue') .moveTo(x + Px, y) .lineTo(x + Px, y + Ah) .moveTo(x + Px + Cw, y) .lineTo(x + Px + Cw, y + Ah) - .stroke('blue') + .stroke() + .strokeColor('green') .moveTo(x, y + Py) .lineTo(x + Aw, y + Py) .moveTo(x, y + Py + Ch) .lineTo(x + Aw, y + Py + Ch) - .stroke('green'); + .stroke(); } // Debug allocated text bounds - doc.rect(x, y, Aw, Ah).stroke('orange'); + doc.strokeColor('orange').rect(x, y, Aw, Ah).stroke(); doc.restore(); } @@ -173,8 +177,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) { doc .save() .lineWidth(border.top) + .strokeColor(borderColor.top) .rect(x, y, width, height) - .stroke(borderColor.top) + .stroke() .restore(); } } else { @@ -184,8 +189,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) { .save() .lineWidth(border.top) .moveTo(x, y) + .strokeColor(borderColor.top) .lineTo(x + width, y) - .stroke(borderColor.top) + .stroke() .restore(); } // Right @@ -194,8 +200,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) { .save() .lineWidth(border.right) .moveTo(x + width, y) + .strokeColor(borderColor.right) .lineTo(x + width, y + height) - .stroke(borderColor.right) + .stroke() .restore(); } // Bottom @@ -204,8 +211,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) { .save() .lineWidth(border.bottom) .moveTo(x + width, y + height) + .strokeColor(borderColor.bottom) .lineTo(x, y + height) - .stroke(borderColor.bottom) + .stroke() .restore(); } // Left @@ -214,8 +222,9 @@ function renderBorder(border, borderColor, x, y, width, height, mask) { .save() .lineWidth(border.left) .moveTo(x, y + height) + .strokeColor(borderColor.left) .lineTo(x, y) - .stroke(borderColor.left) + .stroke() .restore(); } } From d6064025bcec6d034fadfa6e21044c4fc1c69500 Mon Sep 17 00:00:00 2001 From: ajaykrdas Date: Mon, 15 Dec 2025 14:05:18 +0000 Subject: [PATCH 2/3] Fix Table Accessibility Issue: Operator CS/cs not allowed in this current state --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06fcded2..e192cc92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Unreleased - Fix garbled text copying in Chrome/Edge for PDFs with >256 unique characters (#1659) +- Fix Table Accessibility Issue: Operator CS/cs not allowed in this current state ### [v0.17.2] - 2025-08-30 From 7357f915ea8e934a928435bf4190b986bac10e6b Mon Sep 17 00:00:00 2001 From: ajaykrdas Date: Mon, 15 Dec 2025 17:05:15 +0000 Subject: [PATCH 3/3] revert modifications at debug line --- lib/table/render.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/table/render.js b/lib/table/render.js index e50ec9ec..751bb6fc 100644 --- a/lib/table/render.js +++ b/lib/table/render.js @@ -58,9 +58,8 @@ function renderCell(cell, rowStruct) { // Debug cell bounds this.document - .strokeColor('green') .rect(cell.x, cell.y, cell.width, cell.height) - .stroke(); + .stroke('green'); this.document.restore(); } @@ -116,21 +115,19 @@ function renderCellText(cell) { // Debug actual text bounds if (cell.text) { doc - .strokeColor('blue') .moveTo(x + Px, y) .lineTo(x + Px, y + Ah) .moveTo(x + Px + Cw, y) .lineTo(x + Px + Cw, y + Ah) - .stroke() - .strokeColor('green') + .stroke('blue') .moveTo(x, y + Py) .lineTo(x + Aw, y + Py) .moveTo(x, y + Py + Ch) .lineTo(x + Aw, y + Py + Ch) - .stroke(); + .stroke('green'); } // Debug allocated text bounds - doc.strokeColor('orange').rect(x, y, Aw, Ah).stroke(); + doc.rect(x, y, Aw, Ah).stroke('orange'); doc.restore(); }