webodf / ViewerJS

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

Unsupported feature unknown with large base64 pdf #304

Open arngmail opened 2 years ago

arngmail commented 2 years ago

Hi, I receive the message Unsupported feature unkown when rendering a large base64 pdf (4 MB more or less). On many others pdf (always in base64 mode) all works fine.

When rendering this large pdf directly with browser plugin everything works.

This the exception received: Found plugin by mimetype and xhr head: application/pdf pdf.worker.js:1713 The provided value 'moz-chunked-arraybuffer' is not a valid enum value of type XMLHttpRequestResponseType. NetworkManager_request @ pdf.worker.js:1713 pdf.worker.js:243 Error: Invalid XRef stream pdf.worker.js:244 at error (http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.worker.js:244:17) at XRef_readXRef [as readXRef] (http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.worker.js:4259:15) at XRef_parse [as parse] (http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.worker.js:3865:28) at PDFDocument_setup [as setup] (http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.worker.js:3051:17) at PDFDocument_parse [as parse] (http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.worker.js:2938:12) at http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.worker.js:2502:26 at new Promise () at LocalPdfManager_ensure [as ensure] (http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.worker.js:2497:12) at LocalPdfManager.BasePdfManager_ensureDoc [as ensureDoc] (http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.worker.js:2429:19) pdf.worker.js:235 Warning: Unsupported feature "unknown" pdf.worker.js:235 Warning: Indexing all PDF objects pdf.js:235 Warning: Unsupported feature "unknown" :18080/InfoHub/jslib…X1LLH5pSuKqLawPqD:1 Uncaught (in promise) InvalidPDFExceptionmessage: "Invalid PDF structure"name: "InvalidPDFException"[[Prototype]]: Error at InvalidPDFExceptionClosure (http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.js:393:35) at pdfjsWrapper (http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.js:397:3) at http://localhost:18080/InfoHub/jslibs/jquery/plugins/ViewerJS/pdf.js:8040:4

Is there anything I can do ?

Arturo

arngmail commented 2 years ago

Did anybody have such a problem ? Is there any workaround ?

jmscxnulleins commented 2 years ago

Sry wrong VM.

Lets see what u have there. :)

https://stackoverflow.com/questions/61257019/the-provided-value-moz-chunked-arraybuffer-is-not-a-valid-responsetype

https://stackoverflow.com/questions/10516463/request-a-file-with-a-custom-header

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType

https://github.com/wojtekmaj/react-pdf/issues/321

Some Ideas from Errors maybe you as pro get any idea im a nub :)

Wish u all the best and good coding