paulocoutinhox / pdfium-lib

PDFium - Project to compile PDFium library to multiple platforms.
https://pdfviewer.github.io/
MIT License
928 stars 89 forks source link

How to include a PDFIUM logics inside a module. #83

Open KameshRajendran opened 1 year ago

KameshRajendran commented 1 year ago

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 https://github.com/bblanchon/pdfium-binaries/issues/100

Priestch commented 1 year ago

@KameshRajendran you can check #56 for some background.

paulocoutinhox commented 1 year ago

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.

Priestch commented 1 year ago

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

paulocoutinhox commented 1 year ago

It was solved? Can i close?

paulocoutinhox commented 11 months ago

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.