]> git.parisson.com Git - pdf.js.git/commit
Set DeviceGray as initial value for color space
authorIonuț G. Stan <ionut.g.stan@gmail.com>
Thu, 27 Oct 2011 02:45:10 +0000 (05:45 +0300)
committerIonuț G. Stan <ionut.g.stan@gmail.com>
Thu, 27 Oct 2011 02:45:10 +0000 (05:45 +0300)
commit0c321466dce4377f58a038515260c66a0f74603b
treef6f3d6953af58a11132071fe37474ee7a52addff
parent56b9a3543dfd365fb065a85ac056d29064c72797
Set DeviceGray as initial value for color space

See the PDF reference, section 4.3 Graphics State, table 4.2, third row.

> The current color space in which color values are to be interpreted
> (see Section 4.5, “Color Spaces”). There are two separate color space
> parameters: one for stroking and one for all other painting opera-
> tions. Initial value: DeviceGray.

The problem before was that certain PDFs didn't explicitly set the
color space, so a call to `setFillColor` or `setStrokeColor` were failing
when the `getRgb` method was call, as the color space was null.

See source code of CanvasGraphics.prototype.setFillColor/setStrokeColor.
pdf.js