mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 01:35:43 +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
|
@ -705,8 +705,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
|
||||
CanvasGraphics.prototype = {
|
||||
|
||||
beginDrawing: function CanvasGraphics_beginDrawing(transform, viewport,
|
||||
transparency) {
|
||||
beginDrawing({ transform, viewport, transparency,
|
||||
background = null, }) {
|
||||
// For pdfs that use blend modes we have to clear the canvas else certain
|
||||
// blend modes can look wrong since we'd be blending with a white
|
||||
// backdrop. The problem with a transparent backdrop though is we then
|
||||
|
@ -716,7 +716,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
var height = this.ctx.canvas.height;
|
||||
|
||||
this.ctx.save();
|
||||
this.ctx.fillStyle = 'rgb(255, 255, 255)';
|
||||
this.ctx.fillStyle = background || 'rgb(255, 255, 255)';
|
||||
this.ctx.fillRect(0, 0, width, height);
|
||||
this.ctx.restore();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue