Comments (4)
@victorhuangwq if you are attempting to load the PDF from an arbitrary local on the device's file system, you just run into an error. As this could be a security issue. If you wish to load a PDF from the device, you should be able to leverage the SetVirtualHostMapping()
method, mention here.
You'll just need to ensure that the PDF is deployed as an asset/resource with your APPX, with the correct relative path.
from webview2samples.
Thank you, the error no longer appears, but now the application crashes every time. I will try to get this under control.
The PDF file is on a server and is downloaded at runtime and stored in the ApplicationDataPath, from where it is then accessed via WebView.
from webview2samples.
it work now! The SetVirtualHostMapping() is the way to go
from webview2samples.
Some example of how that worked for me
((IWithVirtualHost)webView).SetVirtualHostMapping("webview2.sample", Application.dataPath + "/StreamingAssets/"); webViewComponent.Load(new Uri($"http://webview2.sample/{this.fileName}"));
Actually, if some trouble in path string, Unity crashes and shutdown (nothing about raising errors, exceptions, or Bug console for Unity).
from webview2samples.
Related Issues (20)
- Unity | HoloLens 2 - Application crashing at start HOT 23
- webpage is blank after deploy it in hololens2,app works fine thougth HOT 10
- Can you provide a webview2 sample with java HOT 1
- Null Reference Exception when trying to run the WinForms sample project HOT 3
- Hololens 2 Completed Sample Crashes to Shell Environment on Launch HOT 3
- The WebView2APISample program sometimes fails to restore the visibility of the webview correctly.
- Calling C# native Winrt APIs from WebView2 in WinAppSDK
- HelloWebView contains race condition HOT 2
- Unity Sample Project immediately crashes once deployed to the HoloLens2/ in the Emulator
- Extended Delay in Launching Hololens Application
- Adding Multiple Webview in Unity
- Why does GetSDKBuildVersion remove the first two parts? HOT 1
- dll is missing in Hololens2 Getting Started sample
- Is it possible to run in a Windows Container/App Service to convert HTML to PDFs? HOT 2
- WebView2WpfBrowser example: File ScenarioPermissionManagement.html missing
- How To Build WebView2WpfBrowser HOT 1
- error trying to build WebView2APISample
- EnsureProcessIsClosed function missing correct access rights and does not close handle
- WebView2Browser Sample (C++) Will Not Build X64 in VS2022 OOB, also does not support ARM64 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webview2samples.