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

Merge pull request #13009 from Snuffleupagus/openOrDownloadData

Move the opening of PDF file attachments into the `DownloadManager`-implementations
This commit is contained in:
Tim van der Meij 2021-02-24 20:57:12 +01:00 committed by GitHub
commit 8b7dee0aae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 97 additions and 61 deletions

View file

@ -1982,11 +1982,11 @@ class FileAttachmentAnnotationElement extends AnnotationElement {
* @memberof FileAttachmentAnnotationElement
*/
_download() {
if (!this.downloadManager) {
warn("Download cannot be started due to unavailable download manager");
return;
}
this.downloadManager.downloadData(this.content, this.filename, "");
this.downloadManager?.openOrDownloadData(
this.container,
this.content,
this.filename
);
}
}