diff --git a/bower.json b/bower.json index 102084e67..a0c4ce4ba 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.429", + "version": "1.0.431", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 3c7b8f172..fa08b4066 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.429'; -PDFJS.build = '10db93b'; +PDFJS.version = '1.0.431'; +PDFJS.build = '6d5a041'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -3955,6 +3955,26 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { var x = current.x, y = current.y; for (var i = 0, j = 0, ii = ops.length; i < ii; i++) { switch (ops[i] | 0) { + case OPS.rectangle: + x = args[j++]; + y = args[j++]; + var width = args[j++]; + var height = args[j++]; + if (width === 0) { + width = this.getSinglePixelWidth(); + } + if (height === 0) { + height = this.getSinglePixelWidth(); + } + var xw = x + width; + var yh = y + height; + this.ctx.moveTo(x, y); + this.ctx.lineTo(xw, y); + this.ctx.lineTo(xw, yh); + this.ctx.lineTo(x, yh); + this.ctx.lineTo(x, y); + this.ctx.closePath(); + break; case OPS.moveTo: x = args[j++]; y = args[j++]; @@ -3995,16 +4015,6 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { closePath: function CanvasGraphics_closePath() { this.ctx.closePath(); }, - rectangle: function CanvasGraphics_rectangle(x, y, width, height) { - if (width === 0) { - width = this.getSinglePixelWidth(); - } - if (height === 0) { - height = this.getSinglePixelWidth(); - } - - this.ctx.rect(x, y, width, height); - }, stroke: function CanvasGraphics_stroke(consumePath) { consumePath = typeof consumePath !== 'undefined' ? consumePath : true; var ctx = this.ctx; @@ -4488,7 +4498,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { ury) { // TODO According to the spec we're also suppose to ignore any operators // that set color or include images while processing this type3 font. - this.rectangle(llx, lly, urx - llx, ury - lly); + this.ctx.rect(llx, lly, urx - llx, ury - lly); this.clip(); this.endPath(); }, @@ -4581,7 +4591,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { if (isArray(bbox) && 4 === bbox.length) { var width = bbox[2] - bbox[0]; var height = bbox[3] - bbox[1]; - this.rectangle(bbox[0], bbox[1], width, height); + this.ctx.rect(bbox[0], bbox[1], width, height); this.clip(); this.endPath(); } @@ -4733,7 +4743,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { if (isArray(rect) && 4 === rect.length) { var width = rect[2] - rect[0]; var height = rect[3] - rect[1]; - this.rectangle(rect[0], rect[1], width, height); + this.ctx.rect(rect[0], rect[1], width, height); this.clip(); this.endPath(); } @@ -5869,7 +5879,7 @@ var TilingPattern = (function TilingPatternClosure() { if (bbox && isArray(bbox) && 4 == bbox.length) { var bboxWidth = x1 - x0; var bboxHeight = y1 - y0; - graphics.rectangle(x0, y0, bboxWidth, bboxHeight); + graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); graphics.clip(); graphics.endPath(); } @@ -22251,6 +22261,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { case OPS.closePath: self.buildPath(operatorList, fn, args); continue; + case OPS.rectangle: + self.buildPath(operatorList, fn, args); + continue; } operatorList.addOp(fn, args); } diff --git a/build/pdf.js b/build/pdf.js index cc11f45ee..a861855d8 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.429'; -PDFJS.build = '10db93b'; +PDFJS.version = '1.0.431'; +PDFJS.build = '6d5a041'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -3999,6 +3999,26 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { var x = current.x, y = current.y; for (var i = 0, j = 0, ii = ops.length; i < ii; i++) { switch (ops[i] | 0) { + case OPS.rectangle: + x = args[j++]; + y = args[j++]; + var width = args[j++]; + var height = args[j++]; + if (width === 0) { + width = this.getSinglePixelWidth(); + } + if (height === 0) { + height = this.getSinglePixelWidth(); + } + var xw = x + width; + var yh = y + height; + this.ctx.moveTo(x, y); + this.ctx.lineTo(xw, y); + this.ctx.lineTo(xw, yh); + this.ctx.lineTo(x, yh); + this.ctx.lineTo(x, y); + this.ctx.closePath(); + break; case OPS.moveTo: x = args[j++]; y = args[j++]; @@ -4039,16 +4059,6 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { closePath: function CanvasGraphics_closePath() { this.ctx.closePath(); }, - rectangle: function CanvasGraphics_rectangle(x, y, width, height) { - if (width === 0) { - width = this.getSinglePixelWidth(); - } - if (height === 0) { - height = this.getSinglePixelWidth(); - } - - this.ctx.rect(x, y, width, height); - }, stroke: function CanvasGraphics_stroke(consumePath) { consumePath = typeof consumePath !== 'undefined' ? consumePath : true; var ctx = this.ctx; @@ -4532,7 +4542,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { ury) { // TODO According to the spec we're also suppose to ignore any operators // that set color or include images while processing this type3 font. - this.rectangle(llx, lly, urx - llx, ury - lly); + this.ctx.rect(llx, lly, urx - llx, ury - lly); this.clip(); this.endPath(); }, @@ -4625,7 +4635,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { if (isArray(bbox) && 4 === bbox.length) { var width = bbox[2] - bbox[0]; var height = bbox[3] - bbox[1]; - this.rectangle(bbox[0], bbox[1], width, height); + this.ctx.rect(bbox[0], bbox[1], width, height); this.clip(); this.endPath(); } @@ -4777,7 +4787,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { if (isArray(rect) && 4 === rect.length) { var width = rect[2] - rect[0]; var height = rect[3] - rect[1]; - this.rectangle(rect[0], rect[1], width, height); + this.ctx.rect(rect[0], rect[1], width, height); this.clip(); this.endPath(); } @@ -5913,7 +5923,7 @@ var TilingPattern = (function TilingPatternClosure() { if (bbox && isArray(bbox) && 4 == bbox.length) { var bboxWidth = x1 - x0; var bboxHeight = y1 - y0; - graphics.rectangle(x0, y0, bboxWidth, bboxHeight); + graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); graphics.clip(); graphics.endPath(); } diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 234d8d847..bc447b4bd 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.429'; -PDFJS.build = '10db93b'; +PDFJS.version = '1.0.431'; +PDFJS.build = '6d5a041'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -17415,6 +17415,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { case OPS.closePath: self.buildPath(operatorList, fn, args); continue; + case OPS.rectangle: + self.buildPath(operatorList, fn, args); + continue; } operatorList.addOp(fn, args); } diff --git a/package.json b/package.json index ff96c7577..1c7124bb7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.429", + "version": "1.0.431", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",