Skip to content

Commit

Permalink
Create an OptionalContentConfig-instance once for each task, when r…
Browse files Browse the repository at this point in the history
…unning the reference test-suite

This avoids the need to make a round-trip to the worker-thread for *every* single page that's being tested, which should thus be more efficient.
  • Loading branch information
Snuffleupagus committed Aug 7, 2020
1 parent 8c162f5 commit 59b9f1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ var Driver = (function DriverClosure() {
loadingTask.promise.then(
doc => {
task.pdfDoc = doc;
task.optionalContentConfigPromise = doc.getOptionalContentConfig();

this._nextPage(task, failure);
},
err => {
Expand Down Expand Up @@ -603,6 +605,7 @@ var Driver = (function DriverClosure() {
canvasContext: ctx,
viewport,
renderInteractiveForms: renderForms,
optionalContentConfigPromise: task.optionalContentConfigPromise,
};
var completeRender = function (error) {
// if text layer is present, compose it on top of the page
Expand Down

0 comments on commit 59b9f1f

Please sign in to comment.