1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Using pre-built code for testing.

This commit is contained in:
Yury Delendik 2017-05-30 10:28:50 -05:00 committed by Jonas Jenwald
parent 263479fd6a
commit b66b705ed7
6 changed files with 21 additions and 27 deletions

View file

@ -12,13 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals PDFJS, pdfjsSharedUtil */
/* globals PDFJS, pdfjsDistBuildPdf */
'use strict';
var WAITING_TIME = 100; // ms
var PDF_TO_CSS_UNITS = 96.0 / 72.0;
var StatTimer = pdfjsDistBuildPdf.StatTimer;
/**
* @class
*/
@ -258,7 +260,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
*/
function Driver(options) {
// Configure the global PDFJS object
PDFJS.workerSrc = '../src/worker_loader.js';
PDFJS.workerSrc = '../build/generic/build/pdf.worker.js';
PDFJS.cMapPacked = true;
PDFJS.cMapUrl = '../external/bcmaps/';
PDFJS.enableStats = true;
@ -547,7 +549,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
}
page.cleanup();
task.stats = page.stats;
page.stats = new pdfjsSharedUtil.StatTimer();
page.stats = new StatTimer();
self._snapshot(task, error);
});
initPromise.then(function () {

View file

@ -18,8 +18,7 @@ limitations under the License.
<head>
<title>PDF.js test slave</title>
<meta charset="utf-8">
<script src="../node_modules/systemjs/dist/system.js"></script>
<script src="../systemjs.config.js"></script>
<script src="../build/generic/build/pdf.js"></script>
<script src="driver.js"></script>
</head>
<body>
@ -32,21 +31,12 @@ limitations under the License.
<div id="end"></div>
</body>
<script>
Promise.all([SystemJS.import('pdfjs/display/api'),
SystemJS.import('pdfjs/display/text_layer'),
SystemJS.import('pdfjs/display/annotation_layer'),
SystemJS.import('pdfjs/display/global'),
SystemJS.import('pdfjs/shared/util')])
.then(function (modules) {
window.pdfjsSharedUtil = modules[4];
var driver = new Driver({
disableScrolling: document.getElementById('disableScrolling'),
inflight: document.getElementById('inflight'),
output: document.getElementById('output'),
end: document.getElementById('end')
});
driver.run();
var driver = new Driver({
disableScrolling: document.getElementById('disableScrolling'),
inflight: document.getElementById('inflight'),
output: document.getElementById('output'),
end: document.getElementById('end')
});
driver.run();
</script>
</html>

View file

@ -60,7 +60,7 @@ function initializePDFJS(callback) {
var displayGlobal = modules[0];
// Configure the worker.
displayGlobal.PDFJS.workerSrc = '../../src/worker_loader.js';
displayGlobal.PDFJS.workerSrc = '../../build/generic/build/pdf.worker.js';
// Opt-in to using the latest API.
displayGlobal.PDFJS.pdfjsNext = true;