mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Support rendering appearance streams for annotations
This commit is contained in:
parent
772c7894fb
commit
79831d7ec5
6 changed files with 218 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue