I made an emscripten port of PDFium that allows you to read PDF files on the web:
The first link is mainly for profiling, and the 2nd one is adapted to the PDF.js UI framework. It’s working, but also experimental, some features are missing.
Profiling shows that it’s much faster than PDF.js:
spreadsheets/d/ 1s90JhBjpcbc8FoGruLFzKxaQ- cpKT8qmHgBUsCH9PXY/edit#gid=0
Basically the porting was quite easy, except for two issues I found:
While registering some functions to freetype, there are cast of function pointers into incompatible ones. This is undefined behavior in the C standard, and it is not supported by emscripten — although it does work for most C compilers. I’ve made a fix of this. Not sure if you need this.
Another issue would be, I wonder if there could be an option to disable the JS engine. In this port V8 is not needed at all.
– Lu Wang