New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editable PDF form fields are getting cached #3274
Comments
Thanks for reaching out. I've assigned this to a dev that can help follow up on this. |
Thanks for the bug report! I have added the issue to our backlog. We'll investigate and update the thread soon. Checkout this API ClearBrowsingDataAsync to clear the cache in a time range when pdf widow is closed. |
@monica-ch , please let me know which Enum we should use for only clearing PDF cache fields. Please let us know logic behind the creation/deletion of "PDF Restore Data" folder in cache path. Thanks |
@SureshkPerumal ClearBrowsingDataAsync method currently doesn't just clear pdf cache. Until we find a solution to this, can you use windows API to delete "PDF Restore Data" folder when PDF window is closed or navigated away. |
Hello @SureshkPerumal, Here's a workaround to prevent pdf form field values getting cached locally by a feature flag 'msPdfDataRecovery'. In your App, you can config this through AdditionalBrowserArguments or command line. This will prevent both editable pdf saves the cache to local, and retrieves a local cache, if exists, to editable pdf. The leave site message dialog cannot be activated in WV2 currently, it has some conflicts with WV2. Additional words to your case, the dialog won't guarantee a cache be saved or not, it actually works as it says 'Changes you made may not be saved'. The cache may exist even confirmed to leave from dialog. So the feature flag 'msPdfDataRecovery' may help you better. Thanks, |
@Master-Ukulele/ @monica-ch , CoreWebView2Environment coreEnv = await CoreWebView2Environment.CreateAsync(userDataFolder: webView2CachePath, Confirm above initialization and provide any example. Please share equivalent flag details for "Enable support for XFA in PDF". Pdf is not loading properly in webveiw2 and working in edge after we enabled above option in edge flag.We need to set the above flag in webview2. edge://flags/#edge-pdf-viewer-xfa Thanks |
In the CoreWebView2EnvironmentOptions constructor, you can pass the AdditionalBrowserArguments as The flag for XFA in PDF feature is 'msPdfXFA'. I'm not sure what you mean by "Pdf is not loading properly ... after enabled ...". If you set the flag correctly, if the WebView2 supports the feature, and if your App supports, it should work as expected. However, please don't ask any further questions other than the topic of Pdf cached issue in this thread. It's just better to help others to find the answer when they have the similar issue. If you have other issues, feel free to report it in a new issue. Thanks |
Hi @Master-Ukulele, coreEnv = await CoreWebView2Environment.CreateAsync(userDataFolder: webView2CachePath, Thanks. |
Updates: the msPdfDataRecovery feature has been disabled as default recently in sdk 1.0.1777-prerelease. That means no additional setting is required in the future. |
Description
Use case:
1.User opens editable pdf from webpage which is rendered in webview2 browser control.
2.Edit the field in PDF and close pdf window without saving it.
3.when user open same pdf document type for different account, its prepopulating the previous account data in pdf form fields.
When we edit pdf form fields and close window without saving, seems webview2 cache form field values in local and it pre populate when same document is opened again from the server.it causes issue as it populates data entered for different account.
We could see "PDF Restore Data" folder in below path which has the pdf data.
EBWebView\Default\PDF Restore Data
Tried same use case in edge browser,in edge it shows below Leave site alert message message when click leave it delete pdf restore date folder from edge browser cache path.but in webview2 control we are not getting leave site alert message.
AppData\Local\Microsoft\Edge\User Data\Default\PDF Restore Data
Version
SDK: 1.0.1462.37
Runtime: 110.0.1587.63
Framework: WPF,.NET framework 4.8
OS: wind10
AB#43744375
The text was updated successfully, but these errors were encountered: