1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Pass in the renderInteractiveForms parameter to Annotation_appendToOperatorList, in Page_getOperatorList, instead of to the Annotation constructor (PR 7633 follow-up)

When debugging issue 7643, I noticed that the `forms` tests currently doesn't look like the rendering in the viewer (with `renderInteractiveForms = true` set).
After scratching my head for a little while, I realized that PR 7633 make the implicit assumption that `Page_getOperatorList` (in `core/document.js`) is called *before* fetching the annotation with `PDFPageProxy_getAnnotations` (in `display/api.js`).

Hence this patch, that changes it so that we instead pass in the `renderInteractiveForms` parameter to `Annotation_appendToOperatorList` to ensure that it's always correctly set.
This commit is contained in:
Jonas Jenwald 2016-09-18 22:31:08 +02:00
parent 15e1ae4e3f
commit ded01356c7
2 changed files with 14 additions and 18 deletions

View file

@ -246,8 +246,6 @@ var Page = (function PageClosure() {
});
});
this.renderInteractiveForms = renderInteractiveForms;
var annotationsPromise = pdfManager.ensure(this, 'annotations');
return Promise.all([pageListPromise, annotationsPromise]).then(
function(datas) {
@ -260,7 +258,8 @@ var Page = (function PageClosure() {
}
var annotationsReadyPromise = Annotation.appendToOperatorList(
annotations, pageOpList, partialEvaluator, task, intent);
annotations, pageOpList, partialEvaluator, task, intent,
renderInteractiveForms);
return annotationsReadyPromise.then(function () {
pageOpList.flush(true);
return pageOpList;
@ -331,8 +330,7 @@ var Page = (function PageClosure() {
var annotationRef = annotationRefs[i];
var annotation = annotationFactory.create(this.xref, annotationRef,
this.uniquePrefix,
this.idCounters,
this.renderInteractiveForms);
this.idCounters);
if (annotation) {
annotations.push(annotation);
}