mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
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.
This commit is contained in:
parent
56b9a3543d
commit
0c321466dc
1 changed files with 3 additions and 0 deletions
3
pdf.js
3
pdf.js
|
@ -5344,6 +5344,9 @@ var CanvasExtraState = (function canvasExtraState() {
|
|||
this.strokeColor = '#000000';
|
||||
|
||||
this.old = old;
|
||||
|
||||
this.fillColorSpace = new DeviceGrayCS;
|
||||
this.strokeColorSpace = new DeviceGrayCS;
|
||||
}
|
||||
|
||||
constructor.prototype = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue