Hello👋! I wanted to add a functionality for my Blazor application where I can generate a PDF from my page content. My initial plan is to:
- Use the library in the client side (Blazor WASM)
- Create a Service class and inject it to page
- Retrieve the
byte[] from the generated document and use it as a MemoryStream
- Create a
DotNetStreamReference from the MemoryStream
- Pass the stream reference to a JS script using
JSRuntime.InvokeVoidAsync
- The script gets the stream reference converting to: stream reference => array buffer => blob => url object (string).
- URL object then is used in the HTMLAnchorElement as a
<a /> tag and downloads it
But the problem is on setting my license, I encounter error saying:
blazor.webassembly.js:1 PDF Generation Error: System.TypeInitializationException: The type initializer for 'QuestPDF.Settings' threw an exception.
blazor.webassembly.js:1 ---> System.TypeInitializationException: The type initializer for 'QuestPDF.Helpers.Helpers' threw an exception.
blazor.webassembly.js:1 ---> System.Exception: The QuestPDF library has encountered an issue while loading one of its dependencies.
blazor.webassembly.js:1
blazor.webassembly.js:1 Your runtime is not supported by QuestPDF. The following runtimes are supported: win-x86, win-x64, linux-x64, linux-arm64, linux-musl-x64, osx-x64, osx-arm64. Your current runtime is detected as 'browser-wasm'.
blazor.webassembly.js:1 ---> System.DllNotFoundException: QuestPdfSkia
blazor.webassembly.js:1 at QuestPDF.Skia.SkNativeDependencyCompatibilityChecker.ExecuteNativeCode()
blazor.webassembly.js:1 at QuestPDF.Helpers.NativeDependencyCompatibilityChecker.CheckIfExceptionIsThrownWhenLoadingNativeDependencies()
blazor.webassembly.js:1 --- End of inner exception stack trace ---
blazor.webassembly.js:1 at QuestPDF.Helpers.NativeDependencyCompatibilityChecker.<TestOnce>g__ThrowCompatibilityException|18_0(Exception innerException)
blazor.webassembly.js:1 at QuestPDF.Helpers.NativeDependencyCompatibilityChecker.TestOnce()
blazor.webassembly.js:1 at QuestPDF.Helpers.NativeDependencyCompatibilityChecker.Test()
blazor.webassembly.js:1 at QuestPDF.Skia.SkNativeDependencyCompatibilityChecker.Test()
blazor.webassembly.js:1 at QuestPDF.Helpers.Helpers..cctor()
blazor.webassembly.js:1 --- End of inner exception stack trace ---
blazor.webassembly.js:1 at QuestPDF.Settings..cctor()
blazor.webassembly.js:1 --- End of inner exception stack trace ---
I was thinking if there will be plan on creating a support for browser-wasm?
I've tried to downgrade the version of QuestPDF to 2023.12.X - 2023.9.X but to no avail it produces the same type of error in the console.
Hello👋! I wanted to add a functionality for my Blazor application where I can generate a PDF from my page content. My initial plan is to:
byte[]from the generated document and use it as aMemoryStreamDotNetStreamReferencefrom theMemoryStreamJSRuntime.InvokeVoidAsync<a />tag and downloads itBut the problem is on setting my license, I encounter error saying:
I was thinking if there will be plan on creating a support for browser-wasm?
I've tried to downgrade the version of QuestPDF to
2023.12.X-2023.9.Xbut to no avail it produces the same type of error in the console.