Merge pull request #9436 from timvandermeij/examples

Use `setPDFNetworkStreamFactory` in the `helloworld` and `svgviewer` examples
This commit is contained in:
Tim van der Meij 2018-02-04 19:38:46 +01:00 committed by GitHub
commit 4e40a341a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -7,7 +7,9 @@ Promise.all([System.import('pdfjs/display/api'),
System.resolve('pdfjs/worker_loader')])
.then(function (modules) {
var api = modules[0], global = modules[1], network = modules[2];
api.setPDFNetworkStreamClass(network.PDFNetworkStream);
api.setPDFNetworkStreamFactory((params) => {
return new network.PDFNetworkStream(params);
});
// In production, change this to point to the built `pdf.worker.js` file.
global.PDFJS.workerSrc = modules[3];

View File

@ -43,7 +43,10 @@ Promise.all([System.import('pdfjs/display/api'),
System.resolve('pdfjs/worker_loader')])
.then(function (modules) {
var api = modules[0], svg = modules[1], global = modules[2], network = modules[3];
api.setPDFNetworkStreamClass(network.PDFNetworkStream);
api.setPDFNetworkStreamFactory((params) => {
return new network.PDFNetworkStream(params);
});
// In production, change this to point to the built `pdf.worker.js` file.
global.PDFJS.workerSrc = modules[4];