1.pdfjs-2.13.216-dist.zipで設定が変わっていた
pdfjs-2.13.216-distに更新すると、以下のmessageがconsoleに出るようになった
Deprecated API usage: No "GlobalWorkerOptions.workerSrc" specified.
2.変更箇所
・変更前
PDFJS.workerSrc = '../lib/pdf.worker.js';
loadingTask = PDFJS.getDocument(data);
・変更後
PDFJS.GlobalWorkerOptions.workerSrc = '../lib/pdf.worker.js';
loadingTask = PDFJS.getDocument({"data":data});
3.code
・変更前
const PDFJS = window.pdfjsLib;
PDFJS.workerSrc = '../lib/pdf.worker.js';
loadingTask = PDFJS.getDocument(data);
loadingTask.promise.then( (pdf) => {
this.API.analysisPdfText(pdf, file);
this.DOM.edi.fixed.removeAttribute('disabled');
});
・変更後
const PDFJS = window.pdfjsLib;
PDFJS.GlobalWorkerOptions.workerSrc = '../lib/pdf.worker.js';
loadingTask = PDFJS.getDocument({"data":data});
loadingTask.promise.then( (pdf) => {
this.API.analysisPdfText(pdf, file);
this.DOM.edi.fixed.removeAttribute('disabled');
});