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

How to include a PDFIUM logics inside a module.

KameshRajendran opened this issue · comments

We have downloaded the pdfium-wasm.tgz file from the https://github.com/bblanchon/pdfium-binaries . We have tested that the pdfium-wasm\lib\pdfium.js file looks like below

image

in the same time we have checked your Web demo you used an pdfium.js file and it contains all the logics in a seperate module.
image

Can you please guide us to create a module contains the PDFIUM logics. Since we are facing an issue
bblanchon/pdfium-binaries#100

@KameshRajendran you can check #56 for some background.

Hi,

As i see in your screenshot on your original issue, the problem is not related to PDFium but with Blazor (probably https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor) since the error is inside file _framework/blazor.webassembly.js.

If you want know how to load this PDFium library, see here:
https://github.com/paulocoutinhox/pdfium-lib/blob/master/extras/wasm/template/index.html

Thanks.

The error is caused by line 257 in the screenshot, the Module.arguments should not be accecced after line 258 ran.

The code in _framework/blazor.webassembly.js will load some donet.**.jsfile, it tries to modify the global Module object in this file, including code to access Module.arguments, So as expected, it will abort the program and throw the error.

I think the error is not related to any pdfium project, you may need to ask someone to figure out how to use Dotnet with a wasm module.

In this project, we only use the pdfium.js file, it exposes interfaces as a SDK. Demo code shows how to use these interfaces.

pdfium

It was solved? Can i close?

Hi,

I have updated everything.

You can now use the latest version.

I will close this issue on some days, because we don't have answers.

Thanks.