baskren / Forms9Patch

Simplify image management and text formatting in your Xamarin.Forms apps
http://Forms9Patch.com
Other
128 stars 33 forks source link

[Bug] Forms9Patch webview.toPDF crashes without exception on iOS-Device #103

Open technik5 opened 3 years ago

technik5 commented 3 years ago

Description

Hello sir Baskren, the line in your example: if (await webView.ToPdfAsync("output.pdf") is ToFileResult pdfResult) crashes instantly even if the html-source of the webview contains only "<!DOCTYPE html>

" the bug seems only to exist on iOS and not on Android, where everything works as expected. The webview displays everything normaly. Even in a try - catch - block it won't be catched...could it be a problem with rights? ### Steps to Reproduce 1. Load all nuget-files for pcl,android and ios 2. create a xaml-page with Forms9Patch similar to the example 3. copy code of examplefile 4. create app on physical iOS-Device 5. click-sharebutton -> crash ### Expected Behavior getting a pdf to share ### Actual Behavior crash without exception to homescreen of ios-device ### Basic Information - Version with issue:current - Last known good version:none - IDE: - Platform Target Frameworks: - iOS: 14.4 - Affected Devices: iOS
XamMattia83 commented 2 years ago

I have a similar problem but with try catch block i got this exception: "WebView has zero width or Height". On Android my code runs perfectly.

I'm using iOS 15.0 with a Physical device.

System : Xcode 13.1, Visual studio 8.10.13

Antonio2103 commented 2 years ago

Same issue on ios 14.4 with physical device. Exception "WebView has zero width or Height".

smalgin commented 1 year ago

See my answer for #106 - lmk if it works for you.

xamdinesh commented 1 year ago
Screenshot 2023-07-25 at 6 48 23 PM Screenshot 2023-07-25 at 6 52 44 PM Screenshot 2023-07-25 at 6 50 39 PM

I have also facing this problem for Forms9Patch web view to PDF please any one share the proper solution

xamdinesh commented 1 year ago

please help me for this issue.

baskren commented 1 year ago

@xamdinesh : My apologies, I am no longer supporting Forms9Patch. If you're interested in seeing how to fix this in the source code, you can check out the most recent version of this functionality as implemented for the UNO Platform here: https://github.com/baskren/P42.Uno.HtmlExtensions.