Closed nor0x closed 8 months ago
Hi @nor0x, this is a known issue and the reason I didn't upgrade the WebConverter project to .NET 8.
This has been fixed in emscripten (https://github.com/emscripten-core/emscripten/pull/19004) but .NET 8 uses an older release.
So either we have to wait for .NET 9 that uses a newer emscripten version or hope that freetype (pdfium depends on it) fixes it on their side.
Edit: To be more precise: .NET 8 is locked to emscripten 3.1.34 but this workaround/bugfix was included in 3.1.35. Very unfortunate.
Oops, I didn't mean to close this. This will be fixed once either of those things happen.
thank you for your reply and the explanation - it's very unfortunate that .NET 8 is stuck exactly one version below the one which includes the fix.
I did some research about the issue and was able to get my app building by adding these two properties in my Blazor csproj file
<WasmEnableSIMD>false</WasmEnableSIMD>
<WasmEnableExceptionHandling>false</WasmEnableExceptionHandling>
SIMD support and WASM Exception handling got added in NET 8 and by disabling those features I was able to build and run successfully for now.
I will also try it now with the WebConverter sample from this repo
Thanks a lot for this tip! Setting <WasmEnableExceptionHandling>false</WasmEnableExceptionHandling>
fixes the issue and I could upgrade to .NET 8 now.
However, this project has a dependency to SkiaSharp and I cannot turn off wasm exceptions for this one. I guess SkiaSharp was compiled with -fwasm-exceptions
.
Fortunately staying on emsdk 3.1.12 for SkiaSharp (compiled for .NET 7) seems to work. Even though the version mismatch between 3.1.12 and 3.1.34 causes the compiler warning wasm-ld : warning : function signature mismatch: time
.
i was able to keep SIMD enabled with a change in the NativeFileReference based on the subfolders in the package
<NativeFileReference Include="$(SkiaSharpStaticLibraryPath)\3.1.12\simd\libSkiaSharp.a" />
PDFtoImage 3.1.0 released with support for Blazor WebAssembly. When targeting .NET 7 (or newer) the matching pdfium.a
will be included.
There is a catch, however. I could not include libSkiaSharp.a
automatically, so the consuming project must add this itself:
<NativeFileReference Include="$(SkiaSharpStaticLibraryPath)\3.1.12\simd\libSkiaSharp.a" />
Many thanks for your help, @nor0x! :-)
PDFtoImage version
3.0.0
OS
Windows
OS version
Windows 11
Architecture
x64
Framework
.NET (Core)
App framework
Blazor
Detailed bug report
I cloned the repository and tried to run the
WebConverter
project on .net8 instead of .net7. I'm unable to get the build working and get the following errors in the build outputHas anyone tried running PDFtoImage on Blazor WASM in .NET8?