From 91f7559fa77f993f606ae1b210dd6f93164277fb Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Mon, 25 Nov 2019 14:08:33 -0800 Subject: [PATCH] Update PDFJS.getDocument parameters --- src/components/drivers/pdf-viewer.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/drivers/pdf-viewer.jsx b/src/components/drivers/pdf-viewer.jsx index b471d186..0272feff 100644 --- a/src/components/drivers/pdf-viewer.jsx +++ b/src/components/drivers/pdf-viewer.jsx @@ -67,7 +67,7 @@ export class PDFPage extends React.Component { this.canvas = node} width="670" height="870" /> - ) + ) } ); @@ -92,7 +92,9 @@ export default class PDFDriver extends React.Component { componentDidMount() { const { filePath } = this.props; const containerWidth = this.container.offsetWidth; - PDFJS.getDocument(filePath, null, null, this.progressCallback.bind(this)).then((pdf) => { + const loadingTask = PDFJS.getDocument(filePath); + loadingTask.onProgress = this.progressCallback.bind(this)) + loadingTask.then((pdf) => { this.setState({ pdf, containerWidth }); }); }