1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 23:58:07 +02:00

[api-minor] Remove the obsolete createBlob helper function

At this point in time, all supported browsers have native support for `Blob`; please see https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob#Browser_compatibility.
Furthermore, note how the helper function was throwing an error if `Blob` isn't available anyway.
This commit is contained in:
Jonas Jenwald 2018-08-19 13:37:19 +02:00
parent 160ca55163
commit 50a47be190
3 changed files with 6 additions and 15 deletions

View file

@ -21,10 +21,10 @@ import {
TextLayerMode
} from './ui_utils';
import {
build, createBlob, createObjectURL, getDocument, getFilenameFromUrl,
GlobalWorkerOptions, InvalidPDFException, LinkTarget, loadScript,
MissingPDFException, OPS, PDFWorker, shadow, UnexpectedResponseException,
UNSUPPORTED_FEATURES, URL, version
build, createObjectURL, getDocument, getFilenameFromUrl, GlobalWorkerOptions,
InvalidPDFException, LinkTarget, loadScript, MissingPDFException, OPS,
PDFWorker, shadow, UnexpectedResponseException, UNSUPPORTED_FEATURES, URL,
version
} from 'pdfjs-lib';
import { CursorTool, PDFCursorTools } from './pdf_cursor_tools';
import { PDFRenderingQueue, RenderingStates } from './pdf_rendering_queue';
@ -748,7 +748,7 @@ let PDFViewerApplication = {
}
this.pdfDocument.getData().then(function(data) {
let blob = createBlob(data, 'application/pdf');
const blob = new Blob([data], { type: 'application/pdf', });
downloadManager.download(blob, url, filename);
}).catch(downloadByUrl); // Error occurred, try downloading with the URL.
},