parseFromFileBuffer(pdfBuffer) { // Read the PDF file into a typed array so PDF.js can load it. let rawData = new Uint8Array(pdfBuffer); domFacade.setGlobalDom(); return PDFJSLib.getDocument({ data: rawData, // Try to export JPEG images directly if they don't need any further processing. nativeImageDecoderSupport: PDFJSLib.NativeImageDecoding.DISPLAY }).then((doc) => this.parseDocument(doc)) .then(() => this.metaDataHandler); }