Support rendering appearance streams for annotations

This commit is contained in:
Mack Duan 2013-03-13 12:24:55 -07:00
parent 772c7894fb
commit 79831d7ec5
6 changed files with 218 additions and 5 deletions

View file

@ -1450,6 +1450,38 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.restore();
},
beginAnnotation: function CanvasGraphics_beginAnnotation(rect, transform,
matrix, border) {
this.save();
if (rect && isArray(rect) && 4 == rect.length) {
var width = rect[2] - rect[0];
var height = rect[3] - rect[1];
if (border) {
// TODO(mack): Support different border styles
this.save();
var rgb = border.rgb;
this.setStrokeRGBColor(rgb[0], rgb[1], rgb[2]);
this.setLineWidth(border.width);
this.rectangle(rect[0], rect[1], width, height);
this.stroke();
this.restore();
}
this.rectangle(rect[0], rect[1], width, height);
this.clip();
this.endPath();
}
this.transform.apply(this, transform);
this.transform.apply(this, matrix);
},
endAnnotation: function CanvasGraphics_endAnnotation() {
this.restore();
},
paintJpegXObject: function CanvasGraphics_paintJpegXObject(objId, w, h) {
var domImage = this.objs.get(objId);
if (!domImage) {