1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Attempt to actually resolve ColourSpace names in accordance with the specification (issue 9285)

Please refer to the PDF specification, in particular http://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#G7.3801570

> A colour space shall be specified in one of two ways:
>  - Within a content stream, the CS or cs operator establishes the current colour space parameter in the graphics state. The operand shall always be name object, which either identifies one of the colour spaces that need no additional parameters (DeviceGray, DeviceRGB, DeviceCMYK, or some cases of Pattern) or shall be used as a key in the ColorSpace subdictionary of the current resource dictionary (see 7.8.3, "Resource Dictionaries"). In the latter case, the value of the dictionary entry in turn shall be a colour space array or name. A colour space array shall never be inline within a content stream.
>
> - Outside a content stream, certain objects, such as image XObjects, shall specify a colour space as an explicit parameter, often associated with the key ColorSpace. In this case, the colour space array or name shall always be defined directly as a PDF object, not by an entry in the ColorSpace resource subdictionary. This convention also applies when colour spaces are defined in terms of other colour spaces.
This commit is contained in:
Jonas Jenwald 2017-12-20 15:35:04 +01:00
parent 3925aab010
commit d0c8992e8a
5 changed files with 34 additions and 15 deletions

View file

@ -412,6 +412,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
xref: this.xref,
res: resources,
image,
isInline: inline,
pdfFunctionFactory: this.pdfFunctionFactory,
});
// We force the use of RGBA_32BPP images here, because we can't handle
@ -464,6 +465,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
xref: this.xref,
res: resources,
image,
isInline: inline,
nativeDecoder: nativeImageDecoder,
pdfFunctionFactory: this.pdfFunctionFactory,
}).then((imageObj) => {