Commit 69511d90 authored by Vincent Bechu's avatar Vincent Bechu

[erp5_dms] allow pdf js to return empty pdf

and fix pdf worker path
parent 82681bee
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
var self = this; var self = this;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return PDFViewerApplication.pdfDocument.getData(); if (PDFViewerApplication.pdfDocument) {
return PDFViewerApplication.pdfDocument.getData();
}
}) })
.push(function (data) { .push(function (data) {
var blob = PDFJS.createBlob(data, "application/pdf"); var blob = PDFJS.createBlob(data, "application/pdf");
......
...@@ -35,7 +35,7 @@ var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 25000; ...@@ -35,7 +35,7 @@ var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 25000;
function configure(PDFJS) { function configure(PDFJS) {
PDFJS.imageResourcesPath = './images/'; PDFJS.imageResourcesPath = './images/';
PDFJS.workerSrc = './pdf_js/build/pdf.worker.js'; PDFJS.workerSrc = './build/pdf.worker.js';
PDFJS.cMapUrl = './web/cmaps/'; PDFJS.cMapUrl = './web/cmaps/';
PDFJS.cMapPacked = true; PDFJS.cMapPacked = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment