Invalid CFF header
See original GitHub issueHello I am using this package from quiet some time and this error occurred first time.
While trying to load preview of the following pdf
KANGU-08-07-2019.pdf
i got this: Unhandled Rejection (UnknownErrorException): Invalid CFF header
stack:
UnknownErrorExceptionClosure
node_modules/pdfjs-dist/build/pdf.js:830
(anonymous function)
node_modules/pdfjs-dist/build/pdf.js:833
__w_pdfjs_require__
node_modules/pdfjs-dist/build/pdf.js:79
(anonymous function)
node_modules/pdfjs-dist/build/pdf.js:287
__w_pdfjs_require__
node_modules/pdfjs-dist/build/pdf.js:79
(anonymous function)
node_modules/pdfjs-dist/build/pdf.js:271
(anonymous function)
node_modules/pdfjs-dist/build/pdf.js:273
webpackUniversalModuleDefinition
node_modules/pdfjs-dist/build/pdf.js:23
(anonymous function)
node_modules/pdfjs-dist/build/pdf.js:24
./node_modules/pdfjs-dist/build/pdf.js
http://localhost:3004/static/js/0.chunk.js:92850:30
Full error:
UnknownErrorException {name: "UnknownErrorException", message: "Invalid CFF header", details: "FormatError: Invalid CFF header"}
Additional logs: Warning: Not enough parameters for hstem; actual: 0, expected: 2 Warning: Found too many parameters for stack-clearing command Warning: Missing subrsIndex for callsubr Warning: Failed to compile font g_d0_f1 Warning: Failed to load font ‘g_d0_f1’: ‘SyntaxError: Invalid font data in ArrayBuffer.’.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
windows - PE file - what's missing? - Stack Overflow
Started editing the header to match your listing, and run the exe after each change. Once I changed the SizeOfImage to 1000, I...
Read more >Exploring the PE File Format via Imports - malwology
After loading notepad.exe into CFF Explorer, you will see headers on the left side that comprise the first bytes of a typical Windows...
Read more >src/cff/cffload.c - chromium/src/third_party/freetype2 - Google Git
OpenType and CFF data/program tables loader (body). */ ... two sanity checks for invalid offset tables */ ... FT_TRACE2(( " not a CFF...
Read more >Parsing PE File Headers with C++ - Red Team Notes
In this lab I'm writing a simple Portable Executable (PE) file header parser for 32bit binaries, using C++ as the programming language of...
Read more >Common File User's Guide - Status Codes - NASA
File header indicates IMPORT did not complete. Rerun IMPORT. 200, File was never opened. 201, File was never closed. 202, Invalid ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@patryk2703 after testing out this issue for a bit, the problem seems to reside with pdf.js, which is what this package wraps around. Specifically, the issue seems to have to do with loading the font… Here is a link to a similar issue.
Perhaps you can try to change the font being used?
Even when using the built in version of PDF.js (that comes with Firefox) I am unable to open your PDF file… this is also what makes me believe the issue is with PDF.js and not react-pdf.
Lastly, the console is full of errors when trying to load your file… This is using the built in PDF.js that comes with Firefox, but these same errors are in the console when using react-pdf:
Unfortunately, I do not know how to prevent that error… Although, I know it has to do with
webpack
hot-reloading…That error only occurs in
development
mode - it does not happen inproduction
.Feel free to fork this repository, which I created as a demo (it runs in
production
mode), as it demonstrates how that error does not happen inproduction
mode.