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
10 changes: 8 additions & 2 deletions base/shared/colorspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ var ColorSpace = (function ColorSpaceClosure() {
case 'CMYK':
return 'DeviceCmykCS';
case 'CalGray':
var params = cs[1].getAll();
var params = xref.fetchIfRef(cs[1]);
if (isDict(params)) {
params = params.getAll();
}
return ['CalGrayCS', params];
case 'CalRGB':
return 'DeviceRgbCS';
Expand Down Expand Up @@ -253,7 +256,10 @@ var ColorSpace = (function ColorSpaceClosure() {
var tintFnIR = PDFFunction.getIR(xref, xref.fetchIfRef(cs[3]));
return ['AlternateCS', numComps, alt, tintFnIR];
case 'Lab':
var params = cs[1].getAll();
var params = xref.fetchIfRef(cs[1]);
if (isDict(params)) {
params = params.getAll();
}
return ['LabCS', params];
default:
error('unimplemented color space object "' + mode + '"');
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:jest": "jest --config ./jest.config.json --detectOpenHandles",
"test": "npm run test:jest && npm run parse-r && npm run parse-fd && npm run test:deno && npm run test:bun",
"test:forms": "cd ./test && sh p2j.forms.sh",
"test:misc": "cd ./test && sh p2j.one.sh misc . \"Expected: 15 success, 6 fail exception with stack trace\" ",
"test:misc": "cd ./test && sh p2j.one.sh misc . \"Expected: 16 success, 6 fail exception with stack trace\" ",
"parse": "./bin/pdf2json.js -f ./test/pdf/fd/form/F1040.pdf -o ./test/target/fd/form",
"parse-s": "./bin/pdf2json.js -f ./test/pdf/fd/form/F1040.pdf -o ./test/target/fd/form -s",
"parse-t": "./bin/pdf2json.js -f ./test/pdf/fd/form/F1040.pdf -o ./test/target/fd/form -s -t",
Expand All @@ -47,7 +47,7 @@
"parse-tb": "./bin/pdf2json.js -f ./test/pdf/misc/i242_testingWithTable.pdf -o ./test/target/misc",
"parse-tc": "./bin/pdf2json.js -f ./test/pdf/misc/i293_pdfpac.pdf -o ./test/target/misc",
"parse-rectFix": "./bin/pdf2json.js -f ./test/pdf/misc/pr298_rect_fix_from_upstream.pdf -o ./test/target/misc",
"parse-e": "./bin/pdf2json.js -f ./test/pdf/misc/i306_err_invalid.pdf -o ./test/target/misc",
"parse-e": "./bin/pdf2json.js -f ./test/pdf/misc/i418_precompilato_fake.pdf -o ./test/target/misc",
"build:rollup": "npx rollup -c ./rollup.config.js",
"build:bundle-pdfjs-base": "node rollup/bundle-pdfjs-base.js",
"build": "npm run build:bundle-pdfjs-base && npm run build:rollup",
Expand All @@ -68,8 +68,7 @@
"bin": {
"pdf2json": "bin/pdf2json.js"
},
"dependencies": {
},
"dependencies": {},
"bundleDependencies": [],
"devDependencies": {
"@eslint/js": "^9.37.0",
Expand Down Expand Up @@ -122,4 +121,4 @@
"readme.md",
"license.txt"
]
}
}
Binary file added test/pdf/misc/i418_precompilato_fake.pdf
Binary file not shown.
Loading