paulocoutinhox / pdfium-lib

PDFium - Project to compile PDFium library to multiple platforms.

Home Page:https://pdfviewer.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UTF8ToString is not export

Dingzhaocheng opened this issue · comments

commented

Is your feature request related to a problem? Please describe.

I need your help, I want to use UTF8ToString at the end when I want to get all the text content, but I found an error, RuntimeError: Aborted('UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ))

Same here, I think we might need at least UTF8ToString in EXPORTED_RUNTIME_METHODS...

@Dingzhaocheng

Basically you can replace the line 705 in modules/wasm.py with this:
'EXPORTED_RUNTIME_METHODS='["ccall", "cwrap", "wasmExports", "UTF16ToString" ]'',`

  1. wasmExports is required because the new version of emscripten changed accessibility of 'Module.asm' to 'Module.wasmExports', but you need to list that export here.
  2. UTF16ToString is required to convert the PDFium char array to a string. It is using UTF16 and not UTF8 after all,...
commented

thx, i got it.