1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Fallback on gray colorspace when there are no colorspace and no name in the scn/SCN arguments

It fixes #18894.
This commit is contained in:
Calixte Denizet 2024-10-13 16:00:36 +02:00
parent c3af34271e
commit e7ab8cd8c1
4 changed files with 19 additions and 0 deletions

View file

@ -2079,6 +2079,11 @@ class PartialEvaluator {
case OPS.setFillColorN:
cs = stateManager.state.patternFillColorSpace;
if (!cs) {
if (isNumberArray(args, null)) {
args = ColorSpace.singletons.gray.getRgb(args, 0);
fn = OPS.setFillRGBColor;
break;
}
args = [];
fn = OPS.setFillTransparent;
break;
@ -2106,6 +2111,11 @@ class PartialEvaluator {
case OPS.setStrokeColorN:
cs = stateManager.state.patternStrokeColorSpace;
if (!cs) {
if (isNumberArray(args, null)) {
args = ColorSpace.singletons.gray.getRgb(args, 0);
fn = OPS.setStrokeRGBColor;
break;
}
args = [];
fn = OPS.setStrokeTransparent;
break;