rotate = this.rotate;
return new PDFJS.PageViewport(this.view, scale, rotate, 0, 0);
},
+ /**
+ * @return {Promise} A promise that is resolved with an {array} of the
+ * annotation objects.
+ */
getAnnotations: function() {
+ if (this.annotationsPromise)
+ return this.annotationsPromise;
+
var promise = new PDFJS.Promise();
- var annotations = this.pageInfo.annotations;
- promise.resolve(annotations);
+ this.annotationsPromise = promise;
+ this.transport.getAnnotations(this.pageInfo.pageIndex);
return promise;
},
- render: function(renderContext) {
+ /**
+ * Begins the process of rendering a page to the desired context.
+ * @param {object} params A parameter object that supports:
+ * {
+ * canvasContext(required): A 2D context of a DOM Canvas object.,
+ * textLayer(optional): An object that has beginLayout, endLayout, and
+ * appendText functions.
+ * }
+ * @return {Promise} A promise that is resolved when the page finishes
+ * rendering.
+ */
+ render: function(params) {
var promise = new Promise();
var stats = this.stats;
stats.time('Overall');