diff --git a/web/app.js b/web/app.js index 1cc90cdb7..3ff363ba1 100644 --- a/web/app.js +++ b/web/app.js @@ -595,8 +595,8 @@ let PDFViewerApplication = { this.pdfThumbnailViewer.setDocument(null); this.pdfViewer.setDocument(null); - this.pdfLinkService.setDocument(null, null); - this.pdfDocumentProperties.setDocument(null, null); + this.pdfLinkService.setDocument(null); + this.pdfDocumentProperties.setDocument(null); } this.store = null; this.isInitialViewSet = false; diff --git a/web/pdf_document_properties.js b/web/pdf_document_properties.js index 25711af5d..329c8dddc 100644 --- a/web/pdf_document_properties.js +++ b/web/pdf_document_properties.js @@ -120,7 +120,7 @@ class PDFDocumentProperties { return Promise.all([ info, metadata, - contentDispositionFilename || getPDFFileNameFromURL(this.url), + contentDispositionFilename || getPDFFileNameFromURL(this.url || ''), this._parseFileSize(this.maybeFileSize), this._parseDate(info.CreationDate), this._parseDate(info.ModDate), @@ -187,7 +187,7 @@ class PDFDocumentProperties { * @param {Object} pdfDocument - A reference to the PDF document. * @param {string} url - The URL of the document. */ - setDocument(pdfDocument, url) { + setDocument(pdfDocument, url = null) { if (this.pdfDocument) { this._reset(); this._updateUI(true); diff --git a/web/pdf_link_service.js b/web/pdf_link_service.js index 3f6af1a72..a0130db7e 100644 --- a/web/pdf_link_service.js +++ b/web/pdf_link_service.js @@ -49,7 +49,7 @@ class PDFLinkService { this._pagesRefCache = null; } - setDocument(pdfDocument, baseUrl) { + setDocument(pdfDocument, baseUrl = null) { this.baseUrl = baseUrl; this.pdfDocument = pdfDocument; this._pagesRefCache = Object.create(null);