Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,12 @@ class PartialEvaluator {
case "Type":
break;
case "LW":
if (typeof value !== "number") {
warn(`Invalid LW (line width): ${value}`);
break;
}
gStateObj.push([key, Math.abs(value)]);
break;
case "LC":
case "LJ":
case "ML":
Expand Down Expand Up @@ -2212,6 +2218,18 @@ class PartialEvaluator {
})
);
return;
case OPS.setLineWidth: {
// The thickness should be a non-negative number, as per spec.
// When the value is negative, Acrobat and Poppler take the absolute
// value while PDFium takes the max of 0 and the value.
const [thickness] = args;
if (typeof thickness !== "number") {
warn(`Invalid setLineWidth: ${thickness}`);
continue;
}
args[0] = Math.abs(thickness);
break;
}
case OPS.moveTo:
case OPS.lineTo:
case OPS.curveTo:
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -711,3 +711,4 @@
!issue19505.pdf
!colors.pdf
!red_stamp.pdf
!issue19633.pdf
Binary file added test/pdfs/issue19633.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11971,5 +11971,12 @@
"rounds": 1,
"link": true,
"type": "eq"
},
{
"id": "issue19633",
"file": "pdfs/issue19633.pdf",
"md5": "9993aa298c0214a3d3ff5f90ce0d40bb",
"rounds": 1,
"type": "eq"
}
]