pdfium-lib icon indicating copy to clipboard operation
pdfium-lib copied to clipboard

How to include a PDFIUM logics inside a module.

Open KameshRajendran opened this issue 2 years ago • 5 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 https://github.com/bblanchon/pdfium-binaries/issues/100

KameshRajendran avatar Feb 16 '23 09:02 KameshRajendran

@KameshRajendran you can check #56 for some background.

Priestch avatar Feb 17 '23 14:02 Priestch

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.

paulocoutinhox avatar Feb 24 '23 15:02 paulocoutinhox

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

Priestch avatar Feb 25 '23 01:02 Priestch

It was solved? Can i close?

paulocoutinhox avatar Sep 14 '23 15:09 paulocoutinhox

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.

paulocoutinhox avatar Dec 15 '23 07:12 paulocoutinhox