mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Adds additional parameter so background color of canvas can be set
This commit is contained in:
parent
08f8b68f12
commit
cfc2f36f5c
8 changed files with 429 additions and 27 deletions
|
@ -717,6 +717,11 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
|
|||
* @property {Object} canvasFactory - (optional) The factory that will be used
|
||||
* when creating canvases. The default value is
|
||||
* {DOMCanvasFactory}.
|
||||
* @property {Object} background - (optional) Background to use for the canvas.
|
||||
* Can use any valid canvas.fillStyle: A DOMString parsed as
|
||||
* CSS <color> value, a CanvasGradient object (a linear or
|
||||
* radial gradient) or a CanvasPattern object (a repetitive
|
||||
* image). The default value is 'rgb(255,255,255)'.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -2128,7 +2133,12 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
|
|||
this.objs, this.canvasFactory,
|
||||
params.imageLayer);
|
||||
|
||||
this.gfx.beginDrawing(params.transform, params.viewport, transparency);
|
||||
this.gfx.beginDrawing({
|
||||
transform: params.transform,
|
||||
viewport: params.viewport,
|
||||
transparency,
|
||||
background: params.background,
|
||||
});
|
||||
this.operatorListIdx = 0;
|
||||
this.graphicsReady = true;
|
||||
if (this.graphicsReadyCallback) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue