webodf / ViewerJS

ViewerJS: Document Reader in JavaScript
http://viewerjs.org
1.94k stars 422 forks source link

Update the pdfjs library #284

Open cristianocca opened 4 years ago

cristianocca commented 4 years ago

The current version is quite dated and missing many improvements. I've tried to drop-in replace the library but I'm getting some errors/warnings.

Found plugin by mimetype and xhr head: application/pdf
Deprecated API usage: PDFDocumentLoadingTask.then method, use the `promise` getter instead.

Uncaught (in promise) TypeError: Cannot read property 'transform' of undefined
    at TextLayerBuilder_appendText [as appendText] (text_layer_builder.js:159)
    at TextLayerBuilder_setTextContent [as setTextContent] (text_layer_builder.js:214)
    at index.html:50
rjcalifornia commented 4 years ago

Is ViewerJS still maintained? I don't see any recent commits

cristianocca commented 4 years ago

Definitely out of date. It's also worth noting that it doesn't support password protected files. Might be better off starting with a fresh example from pdfjs.